app.run(function ($rootScope) {
$rootScope.someData = {message: "hello"};
});
You can only get $rootScope
injected to services
and run
function, because each child scope
is inherited from its parent scope and the top level scope is rootScope
. Since it would be ambigous to inject any scope. Only root scope is provided.