diff options
| author | Igor Minar | 2012-01-05 23:03:45 -0800 |
|---|---|---|
| committer | Misko Hevery | 2012-01-10 22:21:53 -0800 |
| commit | 614fd3d55a0d141067c7cd744a29787b1f93b008 (patch) | |
| tree | 35f01ea8d17747278a7d28b8091a10c47f9f1986 /test/widgetsSpec.js | |
| parent | 7146f7063602b82383211533d98e78f7eb2c03db (diff) | |
| download | angular.js-614fd3d55a0d141067c7cd744a29787b1f93b008.tar.bz2 | |
fix(ng:repeat): support repeating over array with null
typeof null == 'object', but it doesn't behave like an object
because its properties can't be dereferenced, so we need
to special-case it.
Closes #702
Diffstat (limited to 'test/widgetsSpec.js')
| -rw-r--r-- | test/widgetsSpec.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 632724ce..e21eb64a 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -501,6 +501,14 @@ describe('widget', function() { expect(element.text()).toBe('a|b|||c||d|'); })); + it('should iterate over all kinds of types', inject(function($rootScope, $compile) { + var element = $compile('<ul><li ng:repeat="item in array">{{item}}|</li></ul>')($rootScope); + $rootScope.array = ['a', 1, null, undefined, {}]; + $rootScope.$digest(); + + expect(element.text()).toBe('a|1|||{\n }|'); + })); + it('should iterate over all kinds of types', inject(function($rootScope, $compile) { var element = $compile('<ul><li ng:repeat="item in array">{{item}}|</li></ul>')($rootScope); |
