Is there a way to dynamically set the remote URL based on my environment in AngularJS?
For example:
app.constant('fooConst', {
urlBase: window.location.origin + '/bar/',
urlBaseWebservice: window.location.origin + '/foo/' + 'bar/rc/'
// urlBase: 'http://localhost:8080/mvsaudeweb/',
// urlBaseWebservice: 'http://localhost:8080/foo/' + 'bar/rc/'
});
How can I configure the 'dist' task in Grunt to automatically change to window.location.origin?
EDIT:
I managed to solve this by using grunt-replace. I no longer need to use window.location.origin; I simply replace it with an empty string. Thanks for the help!