本文整理汇总了TypeScript中angular.IModule.config方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IModule.config方法的具体用法?TypeScript IModule.config怎么用?TypeScript IModule.config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.IModule
的用法示例。
在下文中一共展示了IModule.config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: init
/**
* This method is equivalent to angular.module.config & angular.module.run
*/
private init(router: IRouteFunction) {
this.module = angular.module(this.setting.name, ['ngMessages', 'ui.router', 'ngMaterial']);
this.module.constant('Setting', this.setting);
// CONFIG
AppMenuService.setMenuItems('main-menu', AppMenu);
BreadcrumbController.setAppStates(AppMenu);
AuthService.setDefaultPolicy(AclPolicy.Deny);
this.module.config(['$stateProvider', '$locationProvider', '$urlRouterProvider', '$httpProvider', '$compileProvider',
function ($stateProvider: IStateProvider, $locationProvider: ILocationProvider, $urlRouterProvider: IUrlRouterProvider, $httpProvider: IHttpProvider, $compileProvider: ICompileProvider) {
$compileProvider.debugInfoEnabled(ClientApp.Setting.env != 'production');
$httpProvider.useApplyAsync(true);
router($stateProvider, $locationProvider, $urlRouterProvider);
}]);
/**
* Initiating common services; These services are likely to be injected everywhere
* After this, these services can be used by their `getInstance` method. e.g AuthService.getInstance()
* This action will cause the DI on class names to be much shorter => increasing the readability
*/
this.module.run(['apiService', 'authService', 'logService', 'formService', 'notificationService', 'metaTagsService', 'translateService', (apiService, authService, logService, formService, notificationService, metaTagsService, translateService)=> {
}]);
// RUN
this.module.run(['$rootScope', '$state', 'networkService', 'i18nService', 'appCacheService',
($rootScope: IExtRootScopeService, $state: IStateService, networkService: NetworkService, i18nService: I18nService, appCacheService: AppCacheService)=> {
$rootScope.locale = i18nService.get();
this.aclCheck($rootScope, $state);
this.connectionWatcher(networkService);
appCacheService.update();
this.checkAuthStatus($state);
}]);
}