mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 03:30:02 +08:00
Corrected an issue where properties inherited from __proto__ show up in ng:repeat.
Closses #112
This commit is contained in:
@@ -727,6 +727,18 @@ describe("widget", function(){
|
||||
expect(element.text()).toEqual('misko:swe;shyam:set;');
|
||||
});
|
||||
|
||||
it('should not ng:repeat over parent properties', function(){
|
||||
var Class = function(){};
|
||||
Class.prototype.abc = function(){};
|
||||
Class.prototype.value = 'abc';
|
||||
|
||||
var scope = compile('<ul><li ng:repeat="(key, value) in items" ng:bind="key + \':\' + value + \';\' "></li></ul>');
|
||||
scope.items = new Class();
|
||||
scope.items.name = 'value';
|
||||
scope.$eval();
|
||||
expect(element.text()).toEqual('name:value;');
|
||||
});
|
||||
|
||||
it('should error on wrong parsing of ng:repeat', function(){
|
||||
var scope = compile('<ul><li ng:repeat="i dont parse"></li></ul>');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user