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


TypeScript DOM.setText方法代码示例

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


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

示例1: processStyleElement

 processStyleElement(hostComponentId, templateUrl, styleEl) {
   var cssText = DOM.getText(styleEl);
   cssText = this.styleUrlResolver.resolveUrls(cssText, templateUrl);
   DOM.setText(styleEl, cssText);
   DOM.remove(styleEl);
   insertSharedStyleText(cssText, this.styleHost, styleEl);
   return null;
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:8,代码来源:emulated_unscoped_shadow_dom_strategy.ts

示例2: 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

示例3: processStyleElement

  processStyleElement(hostComponentId: string, templateUrl: string, styleEl): Promise<any> {
    var cssText = DOM.getText(styleEl);

    cssText = this.styleUrlResolver.resolveUrls(cssText, templateUrl);
    var inlinedCss = this.styleInliner.inlineImports(cssText, templateUrl);

    if (isPresent(inlinedCss.asyncResult)) {
      DOM.setText(styleEl, '');
      return inlinedCss.asyncResult.then((css) => {
        css = shimCssForComponent(css, hostComponentId);
        DOM.setText(styleEl, css);
      });
    } else {
      var css = shimCssForComponent(inlinedCss.syncResult, hostComponentId);
      DOM.setText(styleEl, css);
      DOM.remove(styleEl);
      insertStyleElement(this.styleHost, styleEl);
      return null;
    }
  }
开发者ID:baraksu,项目名称:angular,代码行数:20,代码来源:emulated_scoped_shadow_dom_strategy.ts

示例4: beforeEach

 beforeEach(() => {
   fakeDoc = DOM.createHtmlDocument();
   el = DOM.createElement('hello-app', fakeDoc);
   el2 = DOM.createElement('hello-app-2', fakeDoc);
   lightDom = DOM.createElement('light-dom-el', fakeDoc);
   DOM.appendChild(fakeDoc.body, el);
   DOM.appendChild(fakeDoc.body, el2);
   DOM.appendChild(el, lightDom);
   DOM.setText(lightDom, 'loading');
   testBindings = [bind(appDocumentToken).toValue(fakeDoc)];
 });
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:11,代码来源:application_spec.ts

示例5: invokeMementoFor

 invokeMementoFor(memento, currentValue) {
   if (memento instanceof DirectiveBindingMemento) {
     var directiveMemento = memento;
     directiveMemento.invoke(currentValue, this.elementInjectors);
   } else if (memento instanceof ElementBindingMemento) {
     var elementMemento = memento;
     elementMemento.invoke(currentValue, this.bindElements);
   } else {
     var textNodeIndex = memento;
     DOM.setText(this.textNodes[textNodeIndex], currentValue);
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:12,代码来源:view.ts

示例6: process

 process(parent: CompileElement, current: CompileElement, control: CompileControl) {
   if (!current.compileChildren) {
     return;
   }
   var element = current.element;
   var childNodes = DOM.childNodes(DOM.templateAwareRoot(element));
   for (var i = 0; i < childNodes.length; i++) {
     var node = childNodes[i];
     if (DOM.isTextNode(node)) {
       var text = DOM.nodeValue(node);
       var expr = this._parser.parseInterpolation(text, current.elementDescription);
       if (isPresent(expr)) {
         DOM.setText(node, ' ');
         current.bindElement().bindText(node, expr);
       }
     }
   }
 }
开发者ID:Salim-K,项目名称:angular,代码行数:18,代码来源:text_interpolation_parser.ts

示例7: processStyleElement

 processStyleElement(hostComponentId: string, templateUrl: string, styleEl): void {
   let cssText = DOM.getText(styleEl);
   cssText = shimCssForComponent(cssText, hostComponentId);
   DOM.setText(styleEl, cssText);
   this._moveToStyleHost(styleEl);
 }
开发者ID:cedriclam,项目名称:angular,代码行数:6,代码来源:emulated_scoped_shadow_dom_strategy.ts

示例8: shimCssForComponent

 return inlinedCss.asyncResult.then((css) => {
   css = shimCssForComponent(css, hostComponentId);
   DOM.setText(styleEl, css);
 });
开发者ID:baraksu,项目名称:angular,代码行数:4,代码来源:emulated_scoped_shadow_dom_strategy.ts

示例9: setText

 setText(textIndex, value) {
   DOM.setText(this.boundTextNodes[textIndex], value);
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:3,代码来源:view.ts

示例10: setText

 setText(textIndex:number, value:string) {
   DOM.setText(this.boundTextNodes[textIndex], value);
 }
开发者ID:tavwizard,项目名称:angular,代码行数:3,代码来源:view.ts


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