I have an AngularJS application and inside the .run function, I get my site's settings from the server and add them to the root scope.
.run(function ($rootScope, SettingResource) {
// Get the site settings (could be done in app controller?)
$rootScope.SiteSettings = SettingResource.get();
});
I will need to access those settings in other controllers. How can I wait for that to be ready before the other controllers start loading?
Just for reference, here is the resource service:
function settingFactory($resource) {
return $resource('/api/settings', {id: '@id'}, {'update': {'method': 'PUT'}});
}