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


TypeScript MapWrapper.createFromStringMap方法代码示例

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


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

示例1: testChangeDetector

function testChangeDetector(changeDetectorFactory: Function): string[] {
  var ctx = new TestContext();
  ctx.someProp = 'someCtxValue';
  var dir1 = new TestContext();
  dir1.someProp = 'someDirValue';

  var dispatcher = new TestDispatcher([dir1], []);
  var cd = changeDetectorFactory(dispatcher);
  var locals = new Locals(null, MapWrapper.createFromStringMap({'someVar': null}));
  cd.hydrate(ctx, locals, dispatcher, new TestPipes());
  cd.detectChanges();
  return dispatcher.log;
}
开发者ID:TedSander,项目名称:angular,代码行数:13,代码来源:template_compiler_spec.ts

示例2:

var decoratorWithMultipleAttrs = RenderDirectiveMetadata.create({
  selector: 'input[type=text][control]',
  id: 'decoratorWithMultipleAttrs',
  type: RenderDirectiveMetadata.DIRECTIVE_TYPE
});

var someDirectiveWithProps = RenderDirectiveMetadata.create({
  selector: '[some-decor-props]',
  properties: ['dirProp: elProp'],
  readAttributes: ['some-attr']
});

var someDirectiveWithHostProperties = RenderDirectiveMetadata.create({
  selector: '[some-decor-with-host-props]',
  host: MapWrapper.createFromStringMap<string>({'[hostProp]': 'dirProp'})
});

var someDirectiveWithInvalidHostProperties = RenderDirectiveMetadata.create({
  selector: '[some-decor-with-invalid-host-props]',
  host: MapWrapper.createFromStringMap<string>({'[hostProp]': 'dirProp + dirProp2'})
});

var someDirectiveWithHostAttributes = RenderDirectiveMetadata.create({
  selector: '[some-decor-with-host-attrs]',
  host: MapWrapper.createFromStringMap<string>({'attr_name': 'attr_val', 'class': 'foo bar'})
});

var someDirectiveWithEvents = RenderDirectiveMetadata.create({
  selector: '[some-decor-events]',
  host: MapWrapper.createFromStringMap<string>({'(click)': 'doIt()'})
开发者ID:lavinjj,项目名称:angular,代码行数:30,代码来源:directive_parser_spec.ts

示例3: captureDirective

 captureDirective(DirectiveWithBind).then((renderDir) => {
   expect(renderDir.bind).toEqual(MapWrapper.createFromStringMap({'a': 'b'}));
   async.done();
 });
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:4,代码来源:compiler_spec.ts

示例4: DirectiveMetadata

var someViewport = new DirectiveMetadata({
  selector: '[some-vp]',
  id: 'someViewport',
  type: DirectiveMetadata.VIEWPORT_TYPE
});
var someViewport2 = new DirectiveMetadata({
  selector: '[some-vp2]',
  id: 'someViewport2',
  type: DirectiveMetadata.VIEWPORT_TYPE
});
var someDecorator = new DirectiveMetadata({selector: '[some-decor]'});
var someDecoratorIgnoringChildren = new DirectiveMetadata({
  selector: '[some-decor-ignoring-children]',
  compileChildren: false
});
var someDecoratorWithProps = new DirectiveMetadata({
  selector: '[some-decor-props]',
  bind: MapWrapper.createFromStringMap({
    'dirProp': 'elProp',
    'doubleProp': 'elProp | double'
  }),
  setters: ['value'],
  readAttributes: ['some-attr']
});
var someDecoratorWithEvents = new DirectiveMetadata({
  selector: '[some-decor-events]',
  events: MapWrapper.createFromStringMap({'click': 'doIt()'})
});
//# sourceMappingURL=directive_parser_spec.js.map

//# sourceMappingURL=./directive_parser_spec.map
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:31,代码来源:directive_parser_spec.ts

示例5: it

 it('should add variable mappings from the template attribute to the nestedProtoView', () => {
   var rootElement = el('<div><div *foreach="var varName=mapName"></div></div>');
   var results = createPipeline().process(rootElement);
   expect(results[2].inheritedProtoView.variableBindings)
       .toEqual(MapWrapper.createFromStringMap({'mapName': 'varName'}));
 });
开发者ID:188799958,项目名称:angular,代码行数:6,代码来源:view_splitter_spec.ts

示例6: expect

 .then((protoView) => {
   expect(protoView.variableBindings)
       .toEqual(MapWrapper.createFromStringMap({'a': 'b'}));
   async.done();
 });
开发者ID:B-Thapa,项目名称:angular,代码行数:5,代码来源:compiler_common_tests.ts

示例7:

var decoratorWithMultipleAttrs = DirectiveMetadata.create({
  selector: 'input[type=text][control]',
  id: 'decoratorWithMultipleAttrs',
  type: DirectiveMetadata.DIRECTIVE_TYPE
});

var someDirectiveWithProps = DirectiveMetadata.create({
  selector: '[some-decor-props]',
  properties: ['dirProp: elProp'],
  readAttributes: ['some-attr']
});

var someDirectiveWithHostProperties = DirectiveMetadata.create({
  selector: '[some-decor-with-host-props]',
  host: MapWrapper.createFromStringMap({'[hostProp]': 'dirProp'})
});

var someDirectiveWithInvalidHostProperties = DirectiveMetadata.create({
  selector: '[some-decor-with-invalid-host-props]',
  host: MapWrapper.createFromStringMap({'[hostProp]': 'dirProp + dirProp2'})
});

var someDirectiveWithHostAttributes = DirectiveMetadata.create({
  selector: '[some-decor-with-host-attrs]',
  host: MapWrapper.createFromStringMap({'attr_name': 'attr_val', 'class': 'foo bar'})
});

var someDirectiveWithEvents = DirectiveMetadata.create(
    {selector: '[some-decor-events]', host: MapWrapper.createFromStringMap({'(click)': 'doIt()'})});
开发者ID:cedriclam,项目名称:angular,代码行数:29,代码来源:directive_parser_spec.ts

示例8: it

 it('should detect additional entries', () => {
   expect(MapWrapper.createFromStringMap({'a': 1})).not.toEqual(MapWrapper.createFromStringMap({
     'a': 1,
     'b': 1
   }));
 });
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:6,代码来源:test_lib_spec.ts


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