How would I test a $scope.watch (AngularJS) change in Jasmine?

In your unit tests you need to manually call $scope.$digest() or $scope.$apply() to trigger $scope.$watch().

Normally in your code you wouldn’t have to do this, since directives like ng-click do $rootScope.$apply for you behind the scenes.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)