fix($compile): use createMap() for $$observe listeners when initialized from attr interpolation

This commit is contained in:
Jason Bedard
2014-12-13 16:24:24 -08:00
committed by Lucas Galfaso
parent ab41e48493
commit 8e28bb4c2f
2 changed files with 18 additions and 1 deletions

View File

@@ -3218,6 +3218,23 @@ describe('$compile', function() {
});
});
it('should be able to interpolate attribute names which are present in Object.prototype', function() {
var attrs;
module(function() {
directive('attrExposer', valueFn({
link: function($scope, $element, $attrs) {
attrs = $attrs;
}
}));
});
inject(function($compile, $rootScope) {
$compile('<div attr-exposer to-string="{{1 + 1}}" has-own-property="{{1 + 1}}">')($rootScope);
$rootScope.$apply();
expect(attrs.toString).toBe('2');
expect(attrs.hasOwnProperty).toBe('2');
});
});
describe('bind-once', function() {