我想将dashboardApi
的值从http://devdashboard.company.com/'
更改为../api
(相对于一级文件夹的相对路径),我尝试../api
但不是&# 39;工作,如何解决?
'use strict';
angular.module('configuration', [])
.constant('config', {
dashboardApi : 'http://devdashboard.company.com/',
authApi: 'http://urlink.company.com/',
debug: false,
firstName: '',
lastName: '',
userid: '',
employeeid: '',
qGroups: [""],
role : '',
});
答案 0 :(得分:0)
无论您想要更改它,都可以在主角度模块的所需config
内注入component
依赖项。
//make sure configuration module have been injected in main app module.
angular.module('app', ['configuration']);
//here I took an example of config block of your application.
//because generally such setting should be set at configuration time of app.
//the same inject you can do it other component as well, like controller, directive, factory, etc.
angular.module('app').config(['config', function(config){
config.dashboardApi = '../api.'
})