为什么我可以在使用ng-bind
之外ng-app
和ng-controller
使用时使用$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>