0
我在我的angularjs v1服务中声明了这个常量webroot
。在角度服务中声明的常量内使用变量
angular.module('myApp.services', [])
.value('version', '0.1')
.constant('configuration',
{
webroot: 'http://127.0.0.1:10840'
}
])
我有用于通过使用webroot
端口号的变量port
。我想用port
以下面的方式声明常量webroot
;
let port = 10840;
angular.module('myApp.services', [])
.value('version', '0.1')
.constant('configuration',
{
webroot: 'http://127.0.0.1:' + port
}
])
这是怎么做到的角度v1?
http://stackoverflow.com/a/38366461/6449750 –