mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
refactor(scope.$watch): rearrange arguments passed into watcher (newValue, oldValue, scope)
As scopes are injected into controllers now, you have the reference anyway, so having scope as first argument makes no sense… Breaks $watcher gets arguments in different order (newValue, oldValue, scope)
This commit is contained in:
@@ -187,7 +187,7 @@ within the unit-tests.
|
||||
// example of a test
|
||||
it('should trigger a watcher', inject(function($rootScope) {
|
||||
var scope = $rootScope;
|
||||
scope.$watch('name', function(scope, name){
|
||||
scope.$watch('name', function(name) {
|
||||
scope.greeting = 'Hello ' + name + '!';
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user