當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript DOM.appendNode方法代碼示例

本文整理匯總了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;
 }
開發者ID:Thanood,項目名稱:monterey,代碼行數:5,代碼來源:tooltip-renderer.ts

示例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;
      }
開發者ID:aurelia,項目名稱:templating-resources,代碼行數:31,代碼來源:repeat-integration.spec.ts


注:本文中的aurelia-pal.DOM.appendNode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。