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


TypeScript index.rootRenderNodes函數代碼示例

本文整理匯總了TypeScript中@angular/core/src/view/index.rootRenderNodes函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript rootRenderNodes函數的具體用法?TypeScript rootRenderNodes怎麽用?TypeScript rootRenderNodes使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了rootRenderNodes函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('should select root elements based on a node', () => {
   rootData.selectorOrNode = rootNode;
   const view = createRootView(rootData, compViewDef([
                                 elementDef(NodeFlags.None, null, null, 1, 'div'),
                               ]));
   const rootNodes = rootRenderNodes(view);
   expect(rootNodes).toEqual([rootNode]);
 });
開發者ID:not-for-me,項目名稱:angular,代碼行數:8,代碼來源:component_view_spec.ts

示例2: it

 it('should select root elements based on a node', () => {
   const view = createRootView(
       compViewDef([
         elementDef(0, NodeFlags.None, null, null, 0, 'div'),
       ]),
       {}, [], rootNode);
   const rootNodes = rootRenderNodes(view);
   expect(rootNodes).toEqual([rootNode]);
 });
開發者ID:Rowmance,項目名稱:angular,代碼行數:9,代碼來源:component_view_spec.ts

示例3: it

      it('should use root projectable nodes', () => {
        const projectableNodes = [[document.createTextNode('a')], [document.createTextNode('b')]];
        const view = createRootView(
            compViewDef(hostElDef([], [ngContentDef(null, 0), ngContentDef(null, 1)])), {},
            projectableNodes);
        const rootNodes = rootRenderNodes(view);

        expect(getDOM().childNodes(rootNodes[0])[0]).toBe(projectableNodes[0][0]);
        expect(getDOM().childNodes(rootNodes[0])[1]).toBe(projectableNodes[1][0]);
      });
開發者ID:rlugojr,項目名稱:angular,代碼行數:10,代碼來源:ng_content_spec.ts

示例4: it

    it('should include embedded views in root nodes', () => {
      const {view: parentView} = createAndGetRootNodes(compViewDef([
        anchorDef(NodeFlags.EmbeddedViews, null, null, 0, null, embeddedViewDef([
                    elementDef(NodeFlags.None, null, null, 0, 'span', [['name', 'child0']])
                  ])),
        elementDef(NodeFlags.None, null, null, 0, 'span', [['name', 'after']])
      ]));

      const childView0 = Services.createEmbeddedView(parentView, parentView.def.nodes[0]);
      attachEmbeddedView(parentView, asElementData(parentView, 0), 0, childView0);

      const rootNodes = rootRenderNodes(parentView);
      expect(rootNodes.length).toBe(3);
      expect(getDOM().getAttribute(rootNodes[1], 'name')).toBe('child0');
      expect(getDOM().getAttribute(rootNodes[2], 'name')).toBe('after');
    });
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:16,代碼來源:embedded_view_spec.ts

示例5: createAndGetRootNodes

 function createAndGetRootNodes(
     viewDef: ViewDefinition, context: any = null): {rootNodes: any[], view: ViewData} {
   const view = createRootView(viewDef, context);
   const rootNodes = rootRenderNodes(view);
   return {rootNodes, view};
 }
開發者ID:ballipongala,項目名稱:angular,代碼行數:6,代碼來源:query_spec.ts

示例6: createAndGetRootNodes

 function createAndGetRootNodes(
     viewDef: ViewDefinition, ctx?: any): {rootNodes: any[], view: ViewData} {
   const view = createRootView(viewDef, ctx || {});
   const rootNodes = rootRenderNodes(view);
   return {rootNodes, view};
 }
開發者ID:rlugojr,項目名稱:angular,代碼行數:6,代碼來源:ng_content_spec.ts

示例7: createAndGetRootNodes

 function createAndGetRootNodes(viewDef: ViewDefinition): {rootNodes: any[], view: ViewData} {
   const view = createRootView(services, viewDef);
   const rootNodes = rootRenderNodes(view);
   return {rootNodes, view};
 }
開發者ID:JSMike,項目名稱:angular,代碼行數:5,代碼來源:text_spec.ts


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