There are some methods, such as the use of $rootScope
(which is the most common and also the worst) that creates a global variable.
But you can also (by the way, MUST) use a constant
to this end, provided you are sure that the variable will never change, which is your case.
In this file you can define not only one, but several variables to be accessed later. See the example:
var app = angular.module('app', []);
app.constant('minhaConstant', {
url: 'meu/caminho/arquivo.php',
error: 'Algo deu errado, tente novamente',
title: 'Meu Título'
});
And when you need to use, you should do the Constant injection, like any other case, see:
app.controller('mainController', function(minhaConstant, $scope, $http){
$scope.title = minhaConstant.title;
$http.get(minhaConstant.url).then(function(response){
console.log(response.data);
});
})
In the example I declared other variables such as title and default error message, just so you know that you can use this way.