Javascript 使用grunt任务更改常量角度内容
我有一些角度常数,可以根据我的环境设置遥控器: 像 如何使grunt任务“dist”自动更改为window.location.origin 编辑: 我使用grunt replace解决了这个问题 我不需要window.location.origin,替换为空字符串。谢谢我用它来构建具有不同配置集的应用。我用它来构建具有不同配置集的应用Javascript 使用grunt任务更改常量角度内容,javascript,angularjs,gruntjs,Javascript,Angularjs,Gruntjs,我有一些角度常数,可以根据我的环境设置遥控器: 像 如何使grunt任务“dist”自动更改为window.location.origin 编辑: 我使用grunt replace解决了这个问题 我不需要window.location.origin,替换为空字符串。谢谢我用它来构建具有不同配置集的应用。我用它来构建具有不同配置集的应用 app.constant('fooConst', { urlBase: window.location.origin + '/bar/', urlBase
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/'
});