diff --git a/src/ng/compile.js b/src/ng/compile.js index 0285ce6b268b..bf61dd06bcbd 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -3120,7 +3120,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { destination[scopeName] = attrs[attrName] = void 0; } attrs.$observe(attrName, function(value) { - if (isString(value)) { + if (isString(value) || isBoolean(value)) { var oldValue = destination[scopeName]; recordChanges(scopeName, value, oldValue); destination[scopeName] = value; diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index f029fdbe8d79..905846e0300e 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -2712,6 +2712,25 @@ describe('$compile', function() { expect(checkedVal).toEqual(true); }); }); + + it('should handle updates to @ bindings on BOOLEAN attributes', function() { + var componentScope; + module(function($compileProvider) { + $compileProvider.directive('test', function() { + return { + scope: { checked: '@' }, + link: function(scope, element, attrs) { + componentScope = scope; + attrs.$set('checked',true); + } + }; + }); + }); + inject(function($compile, $rootScope) { + $compile('')($rootScope); + expect(componentScope.checked).toEqual(true); + }); + }); });