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
Post a Comment