• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript angular.IModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了IModule类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: registerComponents

export function registerComponents(module:IModule) {
    module
        .component('appMain', new AppMainComponent())
        .component('tarAbout', new AboutComponent())
        .component('tarHome', new HomeComponent())
        .component('tarCounter', new CounterComponent());
}
开发者ID:ericlink,项目名称:ts-angular-redux-seed,代码行数:7,代码来源:index.ts


示例2: function

    return function(target: any): any {
        var moduleName: string = target.name;
        var imports: any[] = options.imports || [];
        var app: IModule = angular.module(moduleName, imports);

        if (options.declarations.length > 0) {
            for(let component of options.declarations) {
                // tslint:disable-next-line:no-string-literal
                console.log(`[ComponentRegistration] ${component["controller"].name} selector: ${component.selector}`);
                app.component(component.selector, component);
            }
        }

        if (options.providers.length > 0) {
            for(let service of options.providers) {
                console.log(`[ServiceRegistration] ${service.name}`);
                app.service(service.name, service);
            }
        }

        return target;
    };
开发者ID:jchandra74,项目名称:angular1.5-typescript-jspm-starter-kit,代码行数:22,代码来源:angular-shim.ts


示例3: 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);
开发者ID:w11k,项目名称:w11k-select,代码行数:25,代码来源:w11k-select.ts


示例4: provide

  provide(module: IModule): DirectiveMockSupplier<any> {
    module.directive(this.name, () => this.directive);

    return this.mock;
  }
开发者ID:hshn,项目名称:angular-directive-mocker,代码行数:5,代码来源:mock-provider.ts


示例5: 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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript angular.IParseService类代码示例发布时间:2022-05-28
下一篇:
TypeScript angular.ILogService类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap