-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
Description
In the tutorial for $watch, a functioning example is never given. This is fine, but later on when explaining the syntax of a $watch expression, there's this example:
$scope.$watch([expression returning watched value],
[change handler],
[objectEquality?]);
This teaches the syntax ambiguously, as it's hard to tell whether to input something like this (correct):
angular.module("root", [])
.controller("index", ["$scope", function($scope) {
$scope.$watch("factor", function (newValue) {
$scope.product = newValue * 2;
});
$scope.factor = 6;
}]);
or this (incorrect):
angular.module("root", [])
.controller("index", ["$scope", function($scope) {
$scope.$watch(["factor"],
[function (newValue) {
$scope.product = newValue * 2;
}]);
$scope.factor = 6;
}]);
Reactions are currently unavailable