当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript IModule.run方法代码示例

本文整理汇总了TypeScript中angular.IModule.run方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IModule.run方法的具体用法?TypeScript IModule.run怎么用?TypeScript IModule.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular.IModule的用法示例。


在下文中一共展示了IModule.run方法的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);
         }]);
 }
开发者ID:VestaRayanAfzar,项目名称:material-cpanel-template,代码行数:33,代码来源:ClientApp.ts


注:本文中的angular.IModule.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。