本文整理匯總了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;
}