{"action":"created","issue":{"url":"https://api.github.com/repos/levibotelho/LearnAngular/issues/46","repository_url":"https://api.github.com/repos/levibotelho/LearnAngular","labels_url":"https://api.github.com/repos/levibotelho/LearnAngular/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/levibotelho/LearnAngular/issues/46/comments","events_url":"https://api.github.com/repos/levibotelho/LearnAngular/issues/46/events","html_url":"https://github.com/levibotelho/LearnAngular/issues/46","id":141453835,"number":46,"title":"Ambiguous syntax explanation in the $watch tutorial","user":{"login":"absolome","id":16587556,"avatar_url":"https://avatars.githubusercontent.com/u/16587556?v=3","gravatar_id":"","url":"https://api.github.com/users/absolome","html_url":"https://github.com/absolome","followers_url":"https://api.github.com/users/absolome/followers","following_url":"https://api.github.com/users/absolome/following{/other_user}","gists_url":"https://api.github.com/users/absolome/gists{/gist_id}","starred_url":"https://api.github.com/users/absolome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/absolome/subscriptions","organizations_url":"https://api.github.com/users/absolome/orgs","repos_url":"https://api.github.com/users/absolome/repos","events_url":"https://api.github.com/users/absolome/events{/privacy}","received_events_url":"https://api.github.com/users/absolome/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/levibotelho/LearnAngular/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-03-17T01:52:50Z","updated_at":"2016-06-25T02:23:18Z","closed_at":null,"body":"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:\r\n\r\n```\r\n$scope.$watch([expression returning watched value],\r\n              [change handler],\r\n              [objectEquality?]);\r\n```\r\n\r\nThis teaches the syntax ambiguously, as it's hard to tell whether to input something like this (correct):\r\n\r\n```\r\nangular.module(\"root\", [])\r\n\t.controller(\"index\", [\"$scope\", function($scope) {\r\n\t\t$scope.$watch(\"factor\", function (newValue) {\r\n\t\t\t$scope.product = newValue * 2;\r\n\t\t});\r\n\r\n\t\t$scope.factor = 6;\r\n\t}]);\r\n```\r\n\r\nor this (incorrect):\r\n\r\n```\r\nangular.module(\"root\", [])\r\n\t.controller(\"index\", [\"$scope\", function($scope) {\r\n\t\t$scope.$watch([\"factor\"], \r\n                      [function (newValue) {\r\n\t\t\t               $scope.product = newValue * 2;\r\n\t\t              }]);\r\n\r\n\t\t$scope.factor = 6;\r\n\t}]);\r\n```"},"comment":{"url":"https://api.github.com/repos/levibotelho/LearnAngular/issues/comments/228502293","html_url":"https://github.com/levibotelho/LearnAngular/issues/46#issuecomment-228502293","issue_url":"https://api.github.com/repos/levibotelho/LearnAngular/issues/46","id":228502293,"user":{"login":"prayagKhanal","id":7698899,"avatar_url":"https://avatars.githubusercontent.com/u/7698899?v=3","gravatar_id":"","url":"https://api.github.com/users/prayagKhanal","html_url":"https://github.com/prayagKhanal","followers_url":"https://api.github.com/users/prayagKhanal/followers","following_url":"https://api.github.com/users/prayagKhanal/following{/other_user}","gists_url":"https://api.github.com/users/prayagKhanal/gists{/gist_id}","starred_url":"https://api.github.com/users/prayagKhanal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prayagKhanal/subscriptions","organizations_url":"https://api.github.com/users/prayagKhanal/orgs","repos_url":"https://api.github.com/users/prayagKhanal/repos","events_url":"https://api.github.com/users/prayagKhanal/events{/privacy}","received_events_url":"https://api.github.com/users/prayagKhanal/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T02:23:18Z","updated_at":"2016-06-25T02:23:18Z","body":"i later figured out how to use $watch thank you i understood more going into the documentation."}}
{"actor":{"display_login":"prayagKhanal"}}