diff --git a/src/ng/compile.js b/src/ng/compile.js index 0963b8d5d2bf..b931b1864541 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1444,7 +1444,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { parentSet(scope, parentValue = lastValue = isolateScope[scopeName]); } } - return parentValue; + return lastValue = parentValue; }); break; diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 6de96f651b2e..c017bfa67e8b 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -2386,6 +2386,24 @@ describe('$compile', function() { expect(componentScope.refAlias).toBe($rootScope.name); })); + it('should not break if local and origin both change to the same value', inject(function() { + $rootScope.name = 'aaa'; + + compile('