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


TypeScript core.provide函数代码示例

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


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

示例1:

import '../../node_modules/angular-material/angular-material.scss'
import './app.scss';

import * as angular from 'angular';
// import * as ngAria from 'angular-aria';
// import * as ngMessages from 'angular-messages';
import * as ngSanitize from 'angular-sanitize';
import * as ngMaterial from 'angular-material';
import '../assets/svg-assets.js';
import { provide } from 'ng-metadata/core';


import { AppComponent } from './app.component.ts';
import { Configure } from './app.config';

const ngMaterialSvg = 'material.svgAssetsCache';
export const AppModule = angular.module( 'app', [
    ngSanitize,
    // ngAria,
    ngMaterial,
    ngMaterialSvg
  ] )
  .config( Configure )
  .directive( ...provide( AppComponent ) );
开发者ID:elmariofredo,项目名称:ngBigParty-II,代码行数:24,代码来源:app.ts

示例2:

import * as angular from "angular"; // import angular globally
import { provide } from "ng-metadata/core";

import { AppCmp } from "./components/my-app.component";

// return/export the module so you can later bootsrap it in the startup using ngMetadata
// define  'app'   module and register all  components  and  services  defined in other files imported above...
export const AppModule = angular.module( "app", [] )
  .directive( ...provide( AppCmp ) )
  .name
;
开发者ID:dmorosinotto,项目名称:ng-metadata-quickstart,代码行数:11,代码来源:app.module.ts

示例3:

// import * as angular from "angular"; // deccoment to include in the bundle and define angular globally
import { provide } from "ng-metadata/core";

import { AppCmp } from "./components/my-app.component";
import { AskCmp } from "./components/ask.component";
import { QuestionSvc } from "./services/question.service";
import myapp from "../myapp"

// return/export the module so you can later bootsrap it in the startup using ngMetadata
// define  'app'   module and register all  components  and  services  defined in other files imported above...
export const AppModule = angular.module( "app", [ myapp ] )
  .directive( ...provide( AppCmp ) )
  .directive( ...provide( AskCmp ) )
  .service( ...provide( QuestionSvc ) )
  .name
;
开发者ID:dmorosinotto,项目名称:TS_config,代码行数:16,代码来源:app.module.ts

示例4:

import * as angular from 'angular';
import { provide } from 'ng-metadata/core';
import {
  MarkForCheckComponent,
  DetachComponent,
  DataProvider,
  ChangeDetectorComponent,
  DataProvider2,
  ReattachComponent
} from './change-detector.component';


export const ChangeDetectorModule = angular
  .module( 'changeDetector', [] )
  .directive(...provide(ChangeDetectorComponent))
  .directive(...provide(MarkForCheckComponent))
  .directive(...provide(DetachComponent))
  .directive(...provide(ReattachComponent))
  .service(...provide(DataProvider))
  .service(...provide(DataProvider2))
  .name;

开发者ID:HansS,项目名称:ng-metadata,代码行数:21,代码来源:index.ts

示例5:

// import * as ngMessages from 'angular-messages';
import * as ngSanitize from 'angular-sanitize';
import * as ngMaterial from 'angular-material';
import '../assets/svg-assets.js';
import { provide } from 'ng-metadata/core';


import { AppComponent } from './app.component.ts';
import { Configure } from './app.config';
import { AppService } from './app.service';
import { MapComponent } from './components/map/map.component';
import { MapHandlerDirective } from './components/map/map-handler.directive';
import { ProgramComponent } from './components/program/progam.component';
import { SpeakersComponent } from './components/speakers/speakers.component';

const ngMaterialSvg = 'material.svgAssetsCache';
export const AppModule = angular.module( 'app', [
    ngSanitize,
    // ngAria,
    ngMaterial,
    ngMaterialSvg
  ] )
  .config( Configure )
  .service( ...provide( AppService ) )
  .directive( ...provide( AppComponent ) )
  .directive( ...provide( MapComponent ) )
  .directive( ...provide( MapHandlerDirective ) )
  .directive( ...provide( ProgramComponent ) )
  .directive( ...provide( SpeakersComponent ) )
  ;
开发者ID:ngParty,项目名称:ngBigParty-II,代码行数:30,代码来源:app.ts

示例6:

import * as ngAnimate from 'angular-animate';
import { provide } from 'ng-metadata/core';
import { CoreModule } from '../core/core.module';
import { PhoneDetailComponent } from './phone-detail.component';
import { phoneAnimation } from './phone.animation';

export const PhoneDetailModule = angular
  .module( 'phonecat.phoneDetail', [
    ngAnimate,
    CoreModule
  ] )
  .directive( ...provide( PhoneDetailComponent ) )
  .animation( '.phone', phoneAnimation )
  .name;
开发者ID:dmorosinotto,项目名称:ng1-migration-workshop,代码行数:14,代码来源:phone-detail.module.ts

示例7: constructor

export class SomeClassToInstantiate{
  constructor(private $timeout:ng.ITimeoutService, private $log:ng.ILogService){}
  greetWithDelay(){ this.$timeout(()=>console.info('greetings from SomeClassToInstantiate with delay!'),1000)}
}

// this is just showcase how to define config for your app or if you are building 3rd party module
configureProviders.$inject = [ '$provide' ];
export function configureProviders( $provide ) {
    $provide.service( ...provide(NgRxStore, {useClass: NgRxStore}) )
    $provide.value( ...provide(DynamicValueToken, {useValue:'hello'}) );
    $provide.factory(...provide(SomeFactoryFnToken, { deps: ['$timeout', '$log'], useFactory: ($timeout, $log) => () => new SomeClassToInstantiate($timeout, $log) }));
}

export const Ng1LegacyModule = angular.module( 'LegacyNg1Module', [
  TabsModule,
  LifecycleHooksModule,
  ChangeDetectorModule,
  TitleHandlerModule
] )

  .directive( ...provide( ElementReadyDirective ) )

  .directive( ...provide( MyValidatorDirective ) )
  .directive( ...provide( MyFooDirective ) )
  .directive( ...provide( MyFormBridgeDirective ) )
  .directive( ...provide( MyDirectiveTesterDirective ) )
  .directive( ...provide( TesterComponent ) )
  .directive( ...provide( GlobalListenerDirective ) )
  .directive( ...provide( TesterAttrDirective ) )
  .name;
开发者ID:gamejolt,项目名称:ng-metadata,代码行数:30,代码来源:index.ts

示例8: configureProviders

export function configureProviders( $provide ) {
    $provide.service( ...provide(NgRxStore, {useClass: NgRxStore}) )
    $provide.value( ...provide(DynamicValueToken, {useValue:'hello'}) );
    $provide.factory(...provide(SomeFactoryFnToken, { deps: ['$timeout', '$log'], useFactory: ($timeout, $log) => () => new SomeClassToInstantiate($timeout, $log) }));
}
开发者ID:gamejolt,项目名称:ng-metadata,代码行数:5,代码来源:index.ts

示例9:

import { MyValidatorDirective } from './directives/my-validator.directive';
import { MyFooDirective } from './directives/my-foo.directive';
import { MyFormBridgeDirective } from './directives/my-form-bridge.directive';
import { MyDirectiveTesterDirective } from './directives/my-directive-tester.directive';
import { TesterAttrDirective } from './directives/my-tester.directive';
import { GlobalListenerDirective } from './directives/global-listener.directive';
import { TesterComponent } from './components/tester/tester.component';
export const AppModule = angular.module( 'app', [
  TabsModule,
  LifecycleHooksModule,
  ChangeDetectorModule,
  TitleHandlerModule
] )

  // we need to register the service manually
  .service( ...provide( Title ) )

  .directive( ...provide( TodoAppCmp ) )
  .directive( ...provide( AddTodoCmp ) )
  .directive( ...provide( TodoItemCmp ) )
  .filter( ...provide( RemainingTodosPipe ) )
  .service( ...provide( TodoStore ) )

  .directive( ...provide( ElementReadyDirective ) )

  .directive( ...provide( MyValidatorDirective ) )
  .directive( ...provide( MyFooDirective ) )
  .directive( ...provide( MyFormBridgeDirective ) )
  .directive( ...provide( MyDirectiveTesterDirective ) )
  .directive( ...provide( TesterComponent ) )
  .directive( ...provide( GlobalListenerDirective ) )
开发者ID:HansS,项目名称:ng-metadata,代码行数:31,代码来源:index.ts


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