aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive/selectSpec.js
diff options
context:
space:
mode:
authorGowtam Lal2013-09-13 12:41:51 +0100
committerPete Bacon Darwin2013-09-13 12:48:19 +0100
commitaa3c54c73f7470999535294899a1c33cd193f455 (patch)
tree9a2439fb5074071e36c3a4dbf576735b3e97b02d /test/ng/directive/selectSpec.js
parentf115751d541596e78f1c2e755ea7e1ad7e1a1f8a (diff)
downloadangular.js-aa3c54c73f7470999535294899a1c33cd193f455.tar.bz2
fix(ngOptions): ignore object properties which start with $
Diffstat (limited to 'test/ng/directive/selectSpec.js')
-rw-r--r--test/ng/directive/selectSpec.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ng/directive/selectSpec.js b/test/ng/directive/selectSpec.js
index 5906ce99..584fe614 100644
--- a/test/ng/directive/selectSpec.js
+++ b/test/ng/directive/selectSpec.js
@@ -692,6 +692,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('<option value="regularProperty">visible</option>');
+ });
describe('binding', function() {