diff options
| author | Igor Minar | 2011-10-18 16:46:27 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-10-18 17:27:43 -0700 | 
| commit | 833eb3c84445110dc1dad238120573f08ed8d102 (patch) | |
| tree | 859e4b51c7b27eed05e1d1047ad89f6583b8b695 /test/widgetsSpec.js | |
| parent | 07926ff1ef2912a6fb8f361ae9b3c98bc3da1dc8 (diff) | |
| download | angular.js-833eb3c84445110dc1dad238120573f08ed8d102.tar.bz2 | |
fix(ng:repeat): repeater should ignore $ and $$ properties
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index b6754b91..90555325 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -290,6 +290,28 @@ describe("widget", function() {        expect(element.text()).toEqual('misko:m:first|shyam:s:last|');      }); +    it('should ignore $ and $$ properties', function() { +      var scope = compile('<ul><li ng:repeat="i in items">{{i}}|</li></ul>'); +      scope.items = ['a', 'b', 'c']; +      scope.items.$$hashkey = 'xxx'; +      scope.items.$root = 'yyy'; +      scope.$digest(); + +      expect(element.text()).toEqual('a|b|c|'); +    }); + +    it('should repeat over nested arrays', function() { +      var scope = compile('<ul>' + +                            '<li ng:repeat="subgroup in groups">' + +                              '<div ng:repeat="group in subgroup">{{group}}|</div>X' + +                            '</li>' + +                           '</ul>'); +      scope.groups = [['a', 'b'], ['c','d']]; +      scope.$digest(); + +      expect(element.text()).toEqual('a|b|Xc|d|X'); +    }); +      describe('stability', function() {        var a, b, c, d, scope, lis;  | 
