Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用grunt任务更改常量角度内容_Javascript_Angularjs_Gruntjs - Fatal编程技术网

Javascript 使用grunt任务更改常量角度内容

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

我有一些角度常数,可以根据我的环境设置遥控器:

如何使grunt任务“dist”自动更改为window.location.origin

编辑:

我使用grunt replace解决了这个问题 我不需要window.location.origin,替换为空字符串。谢谢

我用它来构建具有不同配置集的应用。

我用它来构建具有不同配置集的应用

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/'
});