0
我的角度SPA应用程序具有值提供程序。这个提供者被注入到所有的控制器。在部署时,我手动评论/取消注释要使用的值。我想知道是否有一种方法可以自动切换基于web.config类似机制的值?谢谢。自动配置角度值提供程序
'use strict';
// Demonstrate how to register services
// In this case it is a simple value service.
angular.module('myApp.services', [])
.value('version', '5.0')
//local IIS7
//.value('myWebApiEndpoint', 'http://localhost/CMT Data Service/api/')
//staging IIS
.value('myWebApiEndpoint', 'https://staging.myOrg.org/wcf_webapi/data%20service/api/')
//production IIS
//.value('myWebApiEndpoint', 'https://production.myOrg.org/wcf_webapi/data%20service/api/')