https://segmentfault.com/q/1010000000738004/a-1020000000738812
$ $phase is a state flag bit used internally by Angluar to identify whether the current is in the digest state.
There is usually no need to care about this state in the program (two $ starts to say it is internally used), if you write a code that needs to care about this state, such as this safeapply, there must be something wrong.
- $digest is the watcher array used to execute the registration.
- $apply is used to enforce a dirty check in an extra digest loop.
- $ $phase is used to indicate whether the current is in digest
- $watch is used to register the watcher
Scope.prototype.$watch = function(WATCHFN,Listenerfn,Valueeq){ varWatcher= { WATCHFN:Watchfn, LISTENERFN:Listenerfn|| function(){ }, Last:Initwatchval, Valueeq: !!Valueeq}; This.$ $watchers.Push(watcher); This.$ $lastDirtyWatch = NULL;};
Angularjs $ $phase