1 回答

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊
您需要?jiǎng)?chuàng)建一個(gè)constant提供程序。您可以執(zhí)行以下操作:
angular.module('my-module').constant('myConstant', 'my-value');
然后在您的狀態(tài)提供者中:
$stateProvider
.state('action', {
name: 'action',
url: "/actionitems",
resolve: {
loadDependencies: ['$ocLazyLoad', '$q', '$stateParams', 'myConstant', load]
},
templateUrl: '/app/tool/action/ActionItems.html'
});
function load ($ocLazyLoad, $q, $stateParams, myConstant, module){
// myConstant has the value 'my-value'
...
}
添加回答
舉報(bào)