I want t expose images storage URL to views so I can use it like this in all my views:
<img ng-src="{{storageUrl}}/logo.png"
Right now I have config service which I inject in my every controller, and then expose storageUrl variable to view via $scope.
angular.module('myApp').controller('MyCtrl', [
'$scope',
'AppConfigService',
function ($scope, AppConfigService) {
$scope.storageUrl = AppConfigService.storageUrl;
}
But the problem is that almost in every controller I need to inject this service and expose this varialbe to the view. I don't want to duplicate code so much. So i'm intersting in other ways to globally expose some config variable to the ALL views. What you can suggest?
Thanks