diff options
| author | Misko Hevery | 2010-05-30 16:45:35 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2010-05-30 16:45:35 -0700 | 
| commit | ad18fe144263b966f8930edb672e08b9926e00a1 (patch) | |
| tree | cd46078c014463ab84323f2f9da7c7a59fc7b9a2 /src/directives.js | |
| parent | c7d64f6d124f10c66309042c2d77896215ed43b8 (diff) | |
| download | angular.js-ad18fe144263b966f8930edb672e08b9926e00a1.tar.bz2 | |
compiler exposos both self and this function calling convention
Diffstat (limited to 'src/directives.js')
| -rw-r--r-- | src/directives.js | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/src/directives.js b/src/directives.js index 0a3e10ed..91a98735 100644 --- a/src/directives.js +++ b/src/directives.js @@ -155,16 +155,16 @@ angularWidget("@ng-repeat", function(expression, element){      this.$onEval(function(){        var index = 0, childCount = children.length, childScope, lastElement = reference;        foreach(this.$tryEval(rhs, reference), function(value, key){ -        function assign(scope) { -          scope[valueIdent] = value; -          if (keyIdent) scope[keyIdent] = key; -        }          if (index < childCount) {            // reuse existing child -          assign(childScope = children[index]); +          childScope = children[index]; +          childScope[valueIdent] = value; +          if (keyIdent) childScope[keyIdent] = key;          } else {            // grow children -          assign(childScope = template(element.clone(), createScope(currentScope))); +          childScope = template(element.clone(), createScope(currentScope)); +          childScope[valueIdent] = value; +          if (keyIdent) childScope[keyIdent] = key;            lastElement.after(childScope.$element);            childScope.$index = index;            childScope.$element.attr('ng-repeat-index', index);  | 
