Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bugfix for #14 including refactoring of the create/delete event liste…

…ning and fireing
  • Loading branch information...
commit a0d442aad0154c58d87fdb5e0918be569dcc26a1 1 parent c0b0247
Tobias Bosch authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/test/webapp/unit/repeatSpec.js
View
16 src/test/webapp/unit/repeatSpec.js
@@ -12,6 +12,22 @@ define(['angular'], function(angular) {
expect(createCount).toEqual(2);
});
+ it("should not fire the create event until the end of the eval cycle so double nested lists should work fine", function() {
+ var element = angular.element('<div><div ng:repeat="l in list"><ul><li ng:repeat="l2 in list2"></li></ul></div></div>');
+ var scope = angular.compile(element)();
+ var createCount = 0;
+ var list2CountOnCreate;
+ element.bind('create', function() {
+ createCount++;
+ list2CountOnCreate = element.find('li').length;
+ });
+ scope.list = [0,1];
+ scope.list2 = [10,11];
+ scope.$eval();
+ expect(list2CountOnCreate).toEqual(4);
+ });
+
+
it("should fire the remove event for every entry when the list shrinks", function() {
var element = angular.element('<div><div ng:repeat="l in list"></div></div>');
var scope = angular.compile(element)();
Please sign in to comment.
Something went wrong with that request. Please try again.