本文整理汇总了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;
}
示例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;
}
示例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;
}
}
示例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)];
});
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
示例8: shimCssForComponent
return inlinedCss.asyncResult.then((css) => {
css = shimCssForComponent(css, hostComponentId);
DOM.setText(styleEl, css);
});
示例9: setText
setText(textIndex, value) {
DOM.setText(this.boundTextNodes[textIndex], value);
}
示例10: setText
setText(textIndex:number, value:string) {
DOM.setText(this.boundTextNodes[textIndex], value);
}