From 9ef5d8f31827ba5757ff03fe32fed6757517a36c Mon Sep 17 00:00:00 2001 From: Gowtam Lal Date: Fri, 13 Sep 2013 12:41:51 +0100 Subject: fix(ngOptions): ignore object properties which start with $ --- test/ng/directive/selectSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ng/directive/selectSpec.js') diff --git a/test/ng/directive/selectSpec.js b/test/ng/directive/selectSpec.js index 91d09893..c498b095 100644 --- a/test/ng/directive/selectSpec.js +++ b/test/ng/directive/selectSpec.js @@ -693,6 +693,21 @@ describe('select', function() { expect(jqLite(element.find('option')[0]).text()).toEqual('blank'); }); + it('should ignore $ and $$ properties', function() { + createSelect({ + 'ng-options': 'key as value for (key, value) in object', + 'ng-model': 'selected' + }); + + scope.$apply(function() { + scope.object = {'regularProperty': 'visible', '$$private': 'invisible', '$property': 'invisible'}; + scope.selected = 'regularProperty'; + }); + + var options = element.find('option'); + expect(options.length).toEqual(1); + expect(sortedHtml(options[0])).toEqual(''); + }); describe('binding', function() { -- cgit v1.2.3