When does angularjs create new scopes -


angularjs seems create new scopes, in there parent scope, child scope, , sibling scope.

what determines when new scope created? example, if use ng-inspector view scopes present, there $rootscope, , other scopes, not obvious me other scopes correspond to, nor clear me when these other scopes created/destroyed. believe created/destroyed because $id changes. changes occur if navigate around , press forwards/back.

angular creates new scope every instantiated controller on part of dom. angular creates scope every directive (except scope:false, means directives isolated scope, , scope:true). scope created built in directives such ng-repeat creates scope every repeated item.

also when use ng-if directive can remove , add parts of dom , when adds controllers , directives add scopes again.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -