用咕哝的任务改变恒定的角度内容

change constant angular content with grunt task

本文关键字:改变 任务      更新时间:2023-09-26

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

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

我能做些什么让grunt任务"dist"自动更改为window.location.oorigin?

编辑:

我用grunt替换来解决这个问题我不需要window.location.origin,替换的字符串对我来说是空的。谢谢

我用过这个https://github.com/werk85/grunt-ng-constant以构建具有不同配置集的应用程序。