本文整理汇总了TypeScript中angular.IModule.constant方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IModule.constant方法的具体用法?TypeScript IModule.constant怎么用?TypeScript IModule.constant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.IModule
的用法示例。
在下文中一共展示了IModule.constant方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}]);
}
示例2: Config
'use strict';
/** @internal */
import * as angular from 'angular';
import {IModule} from 'angular';
import {Config} from './model/config.model';
import {W11KSelectHelper} from './w11k-select-helper.factory';
import {w11kSelect} from './w11k-select.directive';
import {w11kSelectOptionDirective} from './w11k-select-option/w11k-select-option.directive';
import {w11kSelectCheckboxDirective} from './w11k-select-checkbox/w11k-checkbox.directive';
import {w11kSelectInfiniteScroll} from './w11k-select-infinite-scroll.directive';
import {keyListener} from './lib/key-listener';
export const module: IModule = angular.module('w11k.select', [
'w11k.dropdownToggle',
'w11k.select.template'
]);
module
.constant('w11kSelectConfig', new Config())
.directive('w11kSelectInfiniteScroll', w11kSelectInfiniteScroll)
.service('w11kSelectHelper', W11KSelectHelper)
.directive('w11kSelect', w11kSelect)
.directive('w11kSelectOption', w11kSelectOptionDirective)
.directive('w11kSelectCheckbox', w11kSelectCheckboxDirective)
.directive('keyListener', keyListener);