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


TypeScript convert.directiveMetadataToMap函数代码示例

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


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

示例1: it

 it('directiveMetadataToMap', () => {
   var someComponent = new DirectiveMetadata({
     compileChildren: false,
     hostListeners: MapWrapper.createFromPairs([['listenKey', 'listenVal']]),
     hostProperties: MapWrapper.createFromPairs([['hostPropKey', 'hostPropVal']]),
     hostActions: MapWrapper.createFromPairs([['hostActionKey', 'hostActionVal']]),
     id: 'someComponent',
     properties: ['propKey: propVal'],
     readAttributes: ['read1', 'read2'],
     selector: 'some-comp',
     type: DirectiveMetadata.COMPONENT_TYPE
   });
   var map = directiveMetadataToMap(someComponent);
   expect(MapWrapper.get(map, 'compileChildren')).toEqual(false);
   expect(MapWrapper.get(map, 'hostListeners'))
       .toEqual(MapWrapper.createFromPairs([['listenKey', 'listenVal']]));
   expect(MapWrapper.get(map, 'hostProperties'))
       .toEqual(MapWrapper.createFromPairs([['hostPropKey', 'hostPropVal']]));
   expect(MapWrapper.get(map, 'hostActions'))
       .toEqual(MapWrapper.createFromPairs([['hostActionKey', 'hostActionVal']]));
   expect(MapWrapper.get(map, 'id')).toEqual('someComponent');
   expect(MapWrapper.get(map, 'properties')).toEqual(['propKey: propVal']);
   expect(MapWrapper.get(map, 'readAttributes')).toEqual(['read1', 'read2']);
   expect(MapWrapper.get(map, 'selector')).toEqual('some-comp');
   expect(MapWrapper.get(map, 'type')).toEqual(DirectiveMetadata.COMPONENT_TYPE);
 });
开发者ID:miguellira,项目名称:angular,代码行数:26,代码来源:convert_spec.ts

示例2: it

 it('directiveMetadataToMap', () => {
   var someComponent = new DirectiveMetadata({
     compileChildren: false,
     hostListeners: MapWrapper.createFromPairs([['LKey', 'LVal']]),
     hostProperties: MapWrapper.createFromPairs([['PKey', 'PVal']]),
     hostActions: MapWrapper.createFromPairs([['AcKey', 'AcVal']]),
     hostAttributes: MapWrapper.createFromPairs([['AtKey', 'AtVal']]),
     id: 'someComponent',
     properties: ['propKey: propVal'],
     readAttributes: ['read1', 'read2'],
     selector: 'some-comp',
     type: DirectiveMetadata.COMPONENT_TYPE,
     exportAs: 'aaa',
     callOnDestroy: true,
     callOnChange: true,
     callOnCheck: true,
     callOnInit: true,
     callOnAllChangesDone: true,
     events: ['onFoo', 'onBar'],
     changeDetection: 'CHECK_ONCE'
   });
   var map = directiveMetadataToMap(someComponent);
   expect(MapWrapper.get(map, 'compileChildren')).toEqual(false);
   expect(MapWrapper.get(map, 'hostListeners'))
       .toEqual(MapWrapper.createFromPairs([['LKey', 'LVal']]));
   expect(MapWrapper.get(map, 'hostProperties'))
       .toEqual(MapWrapper.createFromPairs([['PKey', 'PVal']]));
   expect(MapWrapper.get(map, 'hostActions'))
       .toEqual(MapWrapper.createFromPairs([['AcKey', 'AcVal']]));
   expect(MapWrapper.get(map, 'hostAttributes'))
       .toEqual(MapWrapper.createFromPairs([['AtKey', 'AtVal']]));
   expect(MapWrapper.get(map, 'id')).toEqual('someComponent');
   expect(MapWrapper.get(map, 'properties')).toEqual(['propKey: propVal']);
   expect(MapWrapper.get(map, 'readAttributes')).toEqual(['read1', 'read2']);
   expect(MapWrapper.get(map, 'selector')).toEqual('some-comp');
   expect(MapWrapper.get(map, 'type')).toEqual(DirectiveMetadata.COMPONENT_TYPE);
   expect(MapWrapper.get(map, 'callOnDestroy')).toEqual(true);
   expect(MapWrapper.get(map, 'callOnCheck')).toEqual(true);
   expect(MapWrapper.get(map, 'callOnChange')).toEqual(true);
   expect(MapWrapper.get(map, 'callOnInit')).toEqual(true);
   expect(MapWrapper.get(map, 'callOnAllChangesDone')).toEqual(true);
   expect(MapWrapper.get(map, 'exportAs')).toEqual('aaa');
   expect(MapWrapper.get(map, 'events')).toEqual(['onFoo', 'onBar']);
   expect(MapWrapper.get(map, 'changeDetection')).toEqual('CHECK_ONCE');
 });
开发者ID:AsherBarak,项目名称:angular,代码行数:45,代码来源:convert_spec.ts


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