diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/compileSpec.js | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index f81199cb..9614030c 100644 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -1503,6 +1503,12 @@ describe('$compile', function() {            expect(attr.$observe('someAttr', observeSpy)).toBe(observeSpy);          };        }); +      directive('replaceSomeAttr', valueFn({ +        compile: function(element, attr) { +          attr.$set('someAttr', 'bar-{{1+1}}'); +          expect(element).toBe(attr.$$element); +        } +      }));      })); @@ -1544,6 +1550,14 @@ describe('$compile', function() {      })); +    it('should allow directive to replace interpolated attributes before attr interpolation compilation', inject( +        function($compile, $rootScope) { +      element = $compile('<div some-attr="foo-{{1+1}}" replace-some-attr></div>')($rootScope); +      $rootScope.$digest(); +      expect(element.attr('some-attr')).toEqual('bar-2'); +    })); + +      it('should call observer of non-interpolated attr through $evalAsync',        inject(function($rootScope, $compile) {          $compile('<div some-attr="nonBound" observer></div>')($rootScope); | 
