mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-18 15:50:22 +00:00
Corrected an issue where properties inherited from __proto__ show up in ng:repeat.
Closses #112
This commit is contained in:
parent
5fc2b96b97
commit
9e67da420b
3 changed files with 16 additions and 1 deletions
|
|
@ -16,6 +16,9 @@
|
||||||
- Change API angular.compile(..) to angular.compile(element)([scope], [cloneAttachFn])
|
- Change API angular.compile(..) to angular.compile(element)([scope], [cloneAttachFn])
|
||||||
- remove ng:watch directives since it encourages logic in the UI.
|
- remove ng:watch directives since it encourages logic in the UI.
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
- Corrected an issue where properties inherited from __proto__ show up in ng:repeat.
|
||||||
|
|
||||||
<a name="0.9.11"><a/>
|
<a name="0.9.11"><a/>
|
||||||
# <angular/> 0.9.11 snow-maker (2011-02-08) #
|
# <angular/> 0.9.11 snow-maker (2011-02-08) #
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -927,7 +927,7 @@ angularWidget('@ng:repeat', function(expression, element){
|
||||||
}
|
}
|
||||||
|
|
||||||
for (key in collection) {
|
for (key in collection) {
|
||||||
if (!is_array || collection.hasOwnProperty(key)) {
|
if (collection.hasOwnProperty(key)) {
|
||||||
if (index < childCount) {
|
if (index < childCount) {
|
||||||
// reuse existing child
|
// reuse existing child
|
||||||
childScope = children[index];
|
childScope = children[index];
|
||||||
|
|
|
||||||
|
|
@ -727,6 +727,18 @@ describe("widget", function(){
|
||||||
expect(element.text()).toEqual('misko:swe;shyam:set;');
|
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(){
|
it('should error on wrong parsing of ng:repeat', function(){
|
||||||
var scope = compile('<ul><li ng:repeat="i dont parse"></li></ul>');
|
var scope = compile('<ul><li ng:repeat="i dont parse"></li></ul>');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue