0
据我所知,在app.config
只有提供者和常量是注入配置块,但我找不到任何有效的解决方案,我的情况。在App.config中访问localstorage
我有一个app.config
这样的:
angular
.module('app.core')
.config(initDebug)
.config(initRouter)
.config(initStorage)
所有我想要的是注入common
服务: angular .module('app.core') .factory('common', ($location, $q, $rootScope, messageService, globalData) => { return new Common($location, $q, $rootScope, messageService, globalData); });
我在这app-config
一个UI的路由器,我想做出一个面包屑与加入对象如:
state('class-add?itemId', {
url: '/classAdd?itemId',
templateUrl: '/app/classes/class-add.partial.html',
controller: 'ClassesController',
controllerAs: 'vm',
ncyBreadcrumb: {
---> here goes the common.SelectedClass (from localstorage)
}
})
任何帮助吗?