-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Description
One of the more annoying typos that comes up is calling scope.watch
instead of scope.$watch
.
It would be nice to disallow calling any of the common scope methods on scope
, $scope
, or $rootScope
without the appropriate $
prefix.
Only on these objects:
$scope
scope
$rootScope
These method names are invalid:
new
watch
watchGroup
watchCollection
digest
destroy
eval
evalAsync
apply
applyAsync
on
emit
broadcast
Similarly, it would be nice to error if someone types in scope.$on('destroy', ...)
instead of scope.$on('$destroy', ...)
.