From 0196411dbe179afe24f4faa6d6503ff3f69472da Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Wed, 30 Nov 2011 12:23:58 -0800 Subject: 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)--- docs/content/cookbook/mvc.ngdoc | 2 +- docs/content/guide/dev_guide.scopes.internals.ngdoc | 2 +- docs/content/guide/dev_guide.services.$location.ngdoc | 4 ++-- docs/src/templates/docs.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/content/cookbook/mvc.ngdoc b/docs/content/cookbook/mvc.ngdoc index 71e771bd..cdb5ebdc 100644 --- a/docs/content/cookbook/mvc.ngdoc +++ b/docs/content/cookbook/mvc.ngdoc @@ -66,7 +66,7 @@ no connection between the controller and the view. function same(a, b, c) { return (a==b && b==c) ? a : '';}; } - function readUrl(scope, value) { + function readUrl(value) { if (value) { value = value.split('/'); $scope.nextMove = value[1]; diff --git a/docs/content/guide/dev_guide.scopes.internals.ngdoc b/docs/content/guide/dev_guide.scopes.internals.ngdoc index 66d57a9f..a81d8803 100644 --- a/docs/content/guide/dev_guide.scopes.internals.ngdoc +++ b/docs/content/guide/dev_guide.scopes.internals.ngdoc @@ -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 + '!'; }); diff --git a/docs/content/guide/dev_guide.services.$location.ngdoc b/docs/content/guide/dev_guide.services.$location.ngdoc index 57c39191..2afbf1d2 100644 --- a/docs/content/guide/dev_guide.services.$location.ngdoc +++ b/docs/content/guide/dev_guide.services.$location.ngdoc @@ -618,11 +618,11 @@ you will need to specify an extra property that has two watchers. For example:
// js - controller
-this.$watch('locationPath', function(scope, path) {
+this.$watch('locationPath', function(path) {
$location.path(path);
});
-this.$watch('$location.path()', function(scope, path) {
+this.$watch('$location.path()', function(path) {
scope.locationPath = path;
});
diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js
index bf279df5..7fb9cb22 100644
--- a/docs/src/templates/docs.js
+++ b/docs/src/templates/docs.js
@@ -19,7 +19,7 @@ function DocsController(scope, $location, $window, $cookies, $filter) {
$location.path('/api').replace();
}
- scope.$watch('$location.path()', function(scope, path) {
+ scope.$watch('$location.path()', function(path) {
// ignore non-doc links which are used in examples
if (DOCS_PATH.test(path)) {
var parts = path.split('/');
--
cgit v1.2.3