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


TypeScript DOM.hasProperty方法代码示例

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


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

示例1: createView

 compiler.compile(MyComp).then((pv) => {
   createView(pv);
   ctx.ctxProp = 'Some value';
   cd.detectChanges();
   expect(DOM.hasProperty(view.nodes[0], 'unknown')).toBeFalsy();
   async.done();
 });
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:7,代码来源:integration_spec.ts

示例2: hasProperty

 hasProperty(elm: any, propName: string): boolean {
   var tagName = DOM.tagName(elm);
   if (tagName.indexOf('-') !== -1) {
     // can't tell now as we don't know which properties a custom element will get
     // once it is instantiated
     return true;
   } else {
     return DOM.hasProperty(elm, propName);
   }
 }
开发者ID:KenWilliamson,项目名称:Angular2HostedMobileApp,代码行数:10,代码来源:dom_element_schema_registry.ts

示例3: el

 () => {
   var ce = el('<some-ce></some-ce>');
   var setterFn = setterFactory.createSetter(ce, false, 'someProp');
   ce.someProp = '';
   // Our CJS DOM adapter does not support custom properties,
   // need to exclude here.
   if (DOM.hasProperty(ce, 'someProp')) {
     setterFn(ce, 'Hello');
     expect(ce.someProp).toEqual('Hello');
   }
 });
开发者ID:B-Thapa,项目名称:angular,代码行数:11,代码来源:property_setter_factory_spec.ts

示例4: it

 it('should set the property for custom elements even if it was not present when the setter was created', () => {
   var ce = el('<some-ce></some-ce>');
   var setterFn = setterFactory.createSetter(ce, false, 'someProp');
   ce.someProp = '';
   // Our CJS DOM adapter does not support custom properties,
   // need to exclude here.
   if (DOM.hasProperty(ce, 'someProp')) {
     setterFn(ce, 'Hello');
     expect(ce.someProp).toEqual('Hello');
   }
 });
开发者ID:amzinino,项目名称:angular,代码行数:11,代码来源:property_setter_factory_spec.ts

示例5: function

 setterFn = function(receiver, value) {
   if (DOM.hasProperty(receiver, property)) {
     return propertySetterFn(receiver, value);
   }
 };
开发者ID:188799958,项目名称:angular,代码行数:5,代码来源:property_setter_factory.ts


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