diff --git a/src/ng/compile.js b/src/ng/compile.js index 91cf155edbbc..4bb298616c5c 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -942,13 +942,14 @@ function $CompileProvider($provide) { $element = attrs.$$element; if (newIsolateScopeDirective) { - var LOCAL_REGEXP = /^\s*([@=&])(\??)\s*(\w*)\s*$/; + var LOCAL_REGEXP = /^\s*([@=&])(\??)(\*?)\s*(\w*)\s*$/; var parentScope = scope.$parent || scope; forEach(newIsolateScopeDirective.scope, function(definition, scopeName) { var match = definition.match(LOCAL_REGEXP) || [], - attrName = match[3] || scopeName, + attrName = match[4] || scopeName, + eq = (match[3] == '*'), optional = (match[2] == '?'), mode = match[1], // @, =, or & lastValue, @@ -995,6 +996,11 @@ function $CompileProvider($provide) { parentSet(parentScope, parentValue = lastValue = scope[scopeName]); } } + + if (eq) { + this.eq = true; + } + return parentValue; }); break; diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 5dfad4be7f29..e86fbb65d20b 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -2004,6 +2004,8 @@ describe('$compile', function() { optref: '=?', optrefAlias: '=? optref', optreference: '=?', + eqref: '=*', + eqrefAlias: '=* eqref', expr: '&', exprAlias: '&expr' }, @@ -2166,6 +2168,30 @@ describe('$compile', function() { })); }); + describe('equality object reference', function() { + it('should update local reference to array when origin changes without $digest errors', inject(function() { + $rootScope.list = [{ + name: 'Mark', + value: 45 + }, { + name: 'Misko', + value: 52 + }]; + $rootScope.query = ""; + $rootScope.$apply(); + + compile('