aboutsummaryrefslogtreecommitdiffstats
path: root/test/directivesSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-03-22 16:07:42 -0700
committerMisko Hevery2010-03-22 16:07:42 -0700
commit6f8276a8e3735396999bd158005ca86bb1bb0978 (patch)
tree23bc9ff28e335ef75bac8e7473861e41191625c7 /test/directivesSpec.js
parentd4ba33d075fea5e86963a9ff4982e433fc8c7968 (diff)
downloadangular.js-6f8276a8e3735396999bd158005ca86bb1bb0978.tar.bz2
ng-watch directive
Diffstat (limited to 'test/directivesSpec.js')
-rw-r--r--test/directivesSpec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 2cee20d1..e0e53eeb 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -82,4 +82,16 @@ describe("directives", function(){
});
expect(log).toEqual("\"Expected ng-repeat in form of 'item in collection' but got 'i dont parse'.\";true;");
});
+
+ it('should ng-watch', function(){
+ var scope = compile('<div ng-watch="i: count = count + 1" ng-init="count = 0">');
+ scope.updateView();
+ scope.updateView();
+ expect(scope.get('count')).toEqual(0);
+
+ scope.set('i', 0);
+ scope.updateView();
+ scope.updateView();
+ expect(scope.get('count')).toEqual(1);
+ });
});