javascript - Why I can use `ng-bind` outside of `ng-app`? -


why can use ng-bind outside of ng-app , ng-controller when using $rootscope.variable?

faraworkspaceapp.run(function ($rootscope, $location, $state) {     $rootscope.$on('$statechangesuccess', function (e, tostate, toparams                                                    , fromstate, fromparams) {         $rootscope.pagetitle = tostate.pagetitle;     }); });  <span ng-bind="pagetitle"></span> <div ng-app> </div> 

$scopes tied controller, without controller can't put view. $rootscope tied ng-app, in actual fact can't use outside of ng-app can use outside of ng-controller.

$scopes have inheritance model, means child $scopes automatically value of parent $scope.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -