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


TypeScript PromiseWrapper.isPromise方法代码示例

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


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

示例1: _processStyleElement

 _processStyleElement(current) {
   current.ignoreBindings = true;
   var stylePromise = this._shadowDomStrategy.processStyleElement(this._template.componentId, this._template.absUrl, current.element);
   if (isPresent(stylePromise) && PromiseWrapper.isPromise(stylePromise)) {
     ListWrapper.push(this._subTaskPromises, stylePromise);
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:7,代码来源:shadow_dom_compile_step.ts

示例2:

 promise = PromiseWrapper.then(this._xhr.get(url), (css) => {
   css = this._inlineImports(css, url, inlinedUrls);
   if (PromiseWrapper.isPromise(css)) {
     return css.then((css) => {
       return prefix + this._transformImportedCss(css, mediaQuery, url) + '\n';
     });
   } else {
     return prefix + this._transformImportedCss(css, mediaQuery, url) + '\n';
   }
 }, (error) => `/* failed to import ${url} */\n`);
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:10,代码来源:style_inliner.ts

示例3: _processStyleElement

  _processStyleElement(current: CompileElement, control: CompileControl) {
    var stylePromise = this._shadowDomStrategy.processStyleElement(
        this._template.componentId, this._template.absUrl, current.element);
    if (isPresent(stylePromise) && PromiseWrapper.isPromise(stylePromise)) {
      ListWrapper.push(this._subTaskPromises, stylePromise);
    }

    // Style elements should not be further processed by the compiler, as they can not contain
    // bindings. Skipping further compiler steps allow speeding up the compilation process.
    control.ignoreCurrentElement();
  }
开发者ID:188799958,项目名称:angular,代码行数:11,代码来源:shadow_dom_compile_step.ts

示例4:

 (css) => {
   // resolve nested @import rules
   css = this._inlineImports(css, url, inlinedUrls);
   if (PromiseWrapper.isPromise(css)) {
     // wait until nested @import are inlined
     return css.then((css) => {
       return prefix + this._transformImportedCss(css, mediaQuery, url) + '\n'
     }) ;
   } else {
     // there are no nested @import, return the css
     return prefix + this._transformImportedCss(css, mediaQuery, url) + '\n';
   }
 },
开发者ID:tavwizard,项目名称:angular,代码行数:13,代码来源:style_inliner.ts

示例5: if

 ListWrapper.map(protoView.elementBinders, (elementBinder) => {
   var nestedComponent = elementBinder.componentDirective;
   if (isPresent(nestedComponent) && !(nestedComponent.annotation instanceof DynamicComponent)) {
     var nestedCall = this._compile(nestedComponent);
     if (PromiseWrapper.isPromise(nestedCall)) {
       ListWrapper.push(nestedPVPromises, nestedCall.then((nestedPv) => {
         elementBinder.nestedProtoView = nestedPv;
       }));
     } else {
       elementBinder.nestedProtoView = nestedCall;
     }
   } else if (isPresent(elementBinder.nestedProtoView)) {
     this._compileNestedComponents(elementBinder.nestedProtoView, nestedPVPromises);
   }
 });
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:15,代码来源:compiler.ts

示例6: processStyleElement

 processStyleElement(hostComponentId, templateUrl, styleEl) {
   var cssText = DOM.getText(styleEl);
   cssText = this.styleUrlResolver.resolveUrls(cssText, templateUrl);
   var css = this.styleInliner.inlineImports(cssText, templateUrl);
   if (PromiseWrapper.isPromise(css)) {
     DOM.setText(styleEl, '');
     return css.then((css) => {
       css = shimCssForComponent(css, hostComponentId);
       DOM.setText(styleEl, css);
     });
   } else {
     css = shimCssForComponent(css, hostComponentId);
     DOM.setText(styleEl, css);
   }
   DOM.remove(styleEl);
   insertStyleElement(this.styleHost, styleEl);
   return null;
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:18,代码来源:emulated_scoped_shadow_dom_strategy.ts

示例7: supports

 supports(promise): boolean { return PromiseWrapper.isPromise(promise); }
开发者ID:Dineshchse,项目名称:angular,代码行数:1,代码来源:promise_pipe.ts

示例8: compile

 compile(component) {
   var protoView = this._compile(this._bindDirective(component));
   return PromiseWrapper.isPromise(protoView) ? protoView : PromiseWrapper.resolve(protoView);
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:4,代码来源:compiler.ts


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