本文整理汇总了TypeScript中aurelia-pal.DOM.appendNode方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DOM.appendNode方法的具体用法?TypeScript DOM.appendNode怎么用?TypeScript DOM.appendNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurelia-pal.DOM
的用法示例。
在下文中一共展示了DOM.appendNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getContainer
getContainer() {
const element = DOM.createElement('tooltip');
DOM.appendNode(element);
return element;
}
示例2: OneTimeBindingBehavior
resources.registerValueConverter('toLength', { toView: collection => collection ? (collection.length || collection.size || 0) : 0 });
// no-op binding behavior
resources.registerBindingBehavior('noopBehavior', { bind: () => {/**/}, unbind: () => {/**/} });
// oneTime binding behavior
resources.registerBindingBehavior('oneTime', new OneTimeBindingBehavior());
}
createViewResources(container);
// create the view compiler.
let viewCompiler = container.get(ViewCompiler);
// create the host element and view-slot for all the tests
let host = DOM.createElement('div');
DOM.appendNode(host);
let viewSlot = new ViewSlot(host, true);
// creates a controller given a html template string and a viewmodel instance.
function createController(template, viewModel, viewsRequireLifecycle?: boolean) {
let childContainer = container.createChild();
let viewFactory = viewCompiler.compile(template);
if (viewsRequireLifecycle !== undefined) {
for (let id in viewFactory.instructions) {
let targetInstruction = viewFactory.instructions[id];
for (let behaviorInstruction of targetInstruction.behaviorInstructions) {
if (behaviorInstruction.attrName === 'repeat') {
behaviorInstruction.viewFactory._viewsRequireLifecycle = viewsRequireLifecycle;
}