本文整理汇总了TypeScript中angular2/src/dom/dom_adapter.DOM.getInnerHTML方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DOM.getInnerHTML方法的具体用法?TypeScript DOM.getInnerHTML怎么用?TypeScript DOM.getInnerHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/dom/dom_adapter.DOM
的用法示例。
在下文中一共展示了DOM.getInnerHTML方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createView
compiler.compile(MyComp).then((pv) => {
createView(pv);
ctx.ctxProp = 'Some <span>HTML</span>';
cd.detectChanges();
expect(DOM.getInnerHTML(view.nodes[0])).toEqual('Some <span>HTML</span>');
ctx.ctxProp = 'Some other <div>HTML</div>';
cd.detectChanges();
expect(DOM.getInnerHTML(view.nodes[0])).toEqual('Some other <div>HTML</div>');
async.done();
});
示例2: it
it("should insert empty list", () => {
var c = new Content(content, '');
c.hydrate(null);
c.insert([el("<a></a>")]);
c.insert([]);
expect(DOM.getInnerHTML(parent)).toEqual(`${_scriptStart}${_scriptEnd}`);
});
示例3: it
it('should return a setter for innerHtml', () => {
var setterFn = setterFactory('innerHtml');
setterFn(div, '<span></span>');
expect(DOM.getInnerHTML(div)).toEqual('<span></span>');
var otherSetterFn = setterFactory('innerHtml');
expect(setterFn).toBe(otherSetterFn);
});
示例4: it
it("should insert the nodes", () => {
var c = new Content(content, '');
c.init(null);
c.insert([el("<a></a>"), el("<b></b>")])
expect(DOM.getInnerHTML(parent))
.toEqual(`${_scriptStart}<a></a><b></b>${_scriptEnd}`);
});
示例5: textInViewContainer
function textInViewContainer() {
var out = '';
for (var i = 2; i < dom.childNodes.length - 1; i++) {
if (i != 2)
out += ' ';
out += DOM.getInnerHTML(dom.childNodes[i]);
}
return out;
}
示例6: expect
.then((protoView) => {
expect(DOM.getInnerHTML(resolveInternalDomProtoView(protoView.render).element))
.toEqual('url component');
async.done();
});
示例7: expect
})).then((protoView) => {
expect(DOM.getInnerHTML(protoView.render.delegate.element)).toEqual('url component');
async.done();
});
示例8: it
it('should use a string for big templates', () => {
expect(cloner.prepareForClone(bigTemplate)).toEqual(DOM.getInnerHTML(bigTemplate));
});