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


TypeScript lang.CONST_EXPR函数代码示例

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


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

示例1: iterableChangesAsString

export function iterableChangesAsString({collection = CONST_EXPR([]), previous = CONST_EXPR([]),
                                         additions = CONST_EXPR([]), moves = CONST_EXPR([]),
                                         removals = CONST_EXPR([])}) {
  return "collection: " + collection.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" +
         "additions: " + additions.join(', ') + "\n" + "moves: " + moves.join(', ') + "\n" +
         "removals: " + removals.join(', ') + "\n";
}
开发者ID:AsherBarak,项目名称:angular,代码行数:7,代码来源:util.ts

示例2: makeLocation

 function makeLocation(baseHref: string = '/my/app', provider: any = CONST_EXPR([])): Location {
   locationStrategy = new MockLocationStrategy();
   locationStrategy.internalBaseHref = baseHref;
   let injector = Injector.resolveAndCreate(
       [Location, provide(LocationStrategy, {useValue: locationStrategy}), provider]);
   return location = injector.get(Location);
 }
开发者ID:kreo,项目名称:angular-2-bootstraping,代码行数:7,代码来源:location_spec.ts

示例3: makeLocation

 function makeLocation(baseHref: string = '/my/app', binding: any = CONST_EXPR([])): Location {
   locationStrategy = new MockLocationStrategy();
   locationStrategy.internalBaseHref = baseHref;
   let injector = Injector.resolveAndCreate(
       [Location, bind(LocationStrategy).toValue(locationStrategy), binding]);
   return location = injector.get(Location);
 }
开发者ID:lavinjj,项目名称:angular,代码行数:7,代码来源:location_spec.ts

示例4: makeRouter

 function makeRouter(baseHref: string = '/my/app', provider: any = CONST_EXPR([])): Router {
   locationStrategy = new MockLocationStrategy();
   locationStrategy.internalBaseHref = baseHref;
   let injector = ReflectiveInjector.resolveAndCreate(
       [Router, provide(LocationStrategy, {useValue: locationStrategy}), provider]);
   return router = injector.get(Router);
 }
开发者ID:MikeRyan52,项目名称:router,代码行数:7,代码来源:router.spec.ts

示例5: makeLocation

 function makeLocation(baseHref: string = '/my/app', binding: any = CONST_EXPR([])): Location {
   browserLocation = new DummyBrowserLocation();
   browserLocation.internalBaseHref = baseHref;
   let injector = Injector.resolveAndCreate(
       [Location, bind(BrowserLocation).toValue(browserLocation), binding]);
   return location = injector.get(Location);
 }
开发者ID:AsherBarak,项目名称:angular,代码行数:7,代码来源:location_spec.ts

示例6: detectChanges

 function detectChanges(compiler: ChangeDetectionCompiler, template: string,
                        directives: CompileDirectiveMetadata[] = CONST_EXPR([])): string[] {
   var type =
       new CompileTypeMetadata({name: stringify(SomeComponent), moduleUrl: THIS_MODULE_URL});
   var parsedTemplate = parser.parse(template, directives, 'TestComp');
   var factories =
       compiler.compileComponentRuntime(type, ChangeDetectionStrategy.Default, parsedTemplate);
   return testChangeDetector(factories[0]);
 }
开发者ID:mixed,项目名称:angular,代码行数:9,代码来源:change_detector_compiler_spec.ts

示例7: iterableChangesAsString

export function iterableChangesAsString(
    {collection = CONST_EXPR([]), previous = CONST_EXPR([]), additions = CONST_EXPR([]),
     moves = CONST_EXPR([]), removals = CONST_EXPR([]), identityChanges = CONST_EXPR([])}) {
  return 'collection: ' + collection.join(', ') + '\n' +
      'previous: ' + previous.join(', ') + '\n' +
      'additions: ' + additions.join(', ') + '\n' +
      'moves: ' + moves.join(', ') + '\n' +
      'removals: ' + removals.join(', ') + '\n' +
      'identityChanges: ' + identityChanges.join(', ') + '\n';
}
开发者ID:LordBinary,项目名称:angular,代码行数:10,代码来源:util.ts

示例8: validator

import {forwardRef, Binding} from 'angular2/di';
import {CONST_EXPR} from 'angular2/src/facade/lang';
import {Directive} from '../../../angular2';
import {Validators} from '../validators';

export class NgValidator {
  get validator(): Function { throw "Is not implemented"; }
}

const requiredValidatorBinding =
    CONST_EXPR(new Binding(NgValidator, {toAlias: forwardRef(() => NgRequiredValidator)}));

@Directive({
  selector: '[required][ng-control],[required][ng-form-control],[required][ng-model]',
  hostInjector: [requiredValidatorBinding]
})
export class NgRequiredValidator extends NgValidator {
  get validator(): Function { return Validators.required; }
}
开发者ID:Salim-K,项目名称:angular,代码行数:19,代码来源:validators.ts

示例9: CONST_EXPR

import {OpaqueToken} from 'angular2/di';
import {CONST_EXPR} from 'angular2/src/facade/lang';

export const appComponentRefToken: OpaqueToken = CONST_EXPR(new OpaqueToken('ComponentRef'));
export const appComponentTypeToken: OpaqueToken = CONST_EXPR(new OpaqueToken('RootComponent'));
开发者ID:cedriclam,项目名称:angular,代码行数:5,代码来源:application_tokens.ts


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