mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
fix(ngOptions): ignore object properties which start with $
This commit is contained in:
committed by
Pete Bacon Darwin
parent
f115751d54
commit
aa3c54c73f
@@ -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() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user