aboutsummaryrefslogtreecommitdiffstats
path: root/test/BinderTest.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/BinderTest.js')
-rw-r--r--test/BinderTest.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/BinderTest.js b/test/BinderTest.js
index d565ee30..9ddf38ab 100644
--- a/test/BinderTest.js
+++ b/test/BinderTest.js
@@ -503,6 +503,23 @@ BinderTest.prototype.testRepeaterAdd = function(){
assertEquals(doc.scope().get('items')[0].x, 'ABC');
};
+BinderTest.prototype.testItShouldRemoveExtraChildrenWhenIteratingOverHash = function(){
+ var c = compile('<div ng-repeat="i in items">{{i}}</div>');
+ var items = {};
+ c.scope.set("items", items);
+
+ c.binder.updateView();
+ expect(c.node.find("div").size()).toEqual(0);
+
+ items.name = "misko";
+ c.binder.updateView();
+ expect(c.node.find("div").size()).toEqual(1);
+
+ delete items.name;
+ c.binder.updateView();
+ expect(c.node.find("div").size()).toEqual(0);
+};
+
BinderTest.prototype.testIfTextBindingThrowsErrorDecorateTheSpan = function(){
var a = compile('<div>{{error.throw()}}</div>');
var doc = a.node.find('div');