Is there a way, in a Project that only uses JavaScript (AngularJs) and HTML to assign a global variable used on the controllers.js based on the Publish Profile?
For instance, in a Project of C# I can define a value on the Web.Config->AppSettings and the value changes according to the publish I make (Development, Quality, Production), using the Web.Config.Transform
Since I can't have access to the web.config file of the Javascript Project, is there anyway to me to accomplish this? The value that I need to change is the url to the API, which is different for any environment (Development,Quality,Production).
Presently it's hard coded, like this:
controllers.js //var baseUrl = "http://something.azurewebsites.net/"; //Quality var baseUrl = "http://localhost:1050/"; //Development myApp.controller('loginController',.......
the baseUrl
is then used on every controller to acces the API
So, after many searches and realizing I can't access the Web.config file, I come up with this resolution:
And this does the trick