AngularJS scope life cycle
Scope data goes into life cycle when angular app is loaded into browser completely
- Creation : The rootScope is created by $injector when application is bootstraped. The digest loop is also created in this phase.
- Watcher Registration : In this phase all the watchers for values / expression are registered. Watchers propagate model changes automatically.
- Model Mutation : This phase occurs when data in scope changes. Digest cycle is called, DOM and Model are updated accordingly.
- Mutation Observation : This phase after the digest cycle is completed. This phase calculates that the model changes done by the digest cycle is done or not .
- Scope destruction : This phase occurs when child scopes are no longer needed and they are removed from browsers memory by using $destroy function.
No comments