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


TypeScript index.textDef函數代碼示例

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


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

示例1: it

    it('should create views with multiple root ng-content nodes', () => {
      const {view, rootNodes} = createAndGetRootNodes(compViewDef(hostElDef(
          [textDef(0, ['a']), textDef(1, ['b'])], [ngContentDef(null, 0), ngContentDef(null, 1)])));

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

示例2: it

 it('should create views with multiple root text nodes', () => {
   const rootNodes = createAndGetRootNodes(compViewDef([
                       textDef(0, null, ['a']),
                       textDef(1, null, ['b']),
                     ])).rootNodes;
   expect(rootNodes.length).toBe(2);
 });
開發者ID:Cammisuli,項目名稱:angular,代碼行數:7,代碼來源:text_spec.ts

示例3: it

      it('should reverse child order for root nodes', () => {
        const vd = viewDef(ViewFlags.None, [
          textDef(null, ['a']),  // level 0, index 0
          textDef(null, ['a']),  // level 0, index 0
        ]);

        expect(reverseChildOrder(vd)).toEqual([1, 0]);
      });
開發者ID:manekinekko,項目名稱:angular,代碼行數:8,代碼來源:view_def_spec.ts

示例4: it

      it('should calculate parents for one level', () => {
        const vd = viewDef(ViewFlags.None, [
          elementDef(NodeFlags.None, null, null, 2, 'span'),
          textDef(null, ['a']),
          textDef(null, ['a']),
        ]);

        expect(parents(vd)).toEqual([null, 0, 0]);
      });
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:9,代碼來源:view_def_spec.ts

示例5: it

      it('should calculate parents for one level, multiple roots', () => {
        const vd = viewDef(ViewFlags.None, [
          elementDef(NodeFlags.None, 1, 'span'),
          textDef(['a']),
          elementDef(NodeFlags.None, 1, 'span'),
          textDef(['a']),
          textDef(['a']),
        ]);

        expect(parents(vd)).toEqual([undefined, 0, undefined, 2, undefined]);
      });
開發者ID:JSMike,項目名稱:angular,代碼行數:11,代碼來源:view_def_spec.ts

示例6: it

      it('should calculate parents for one level, multiple roots', () => {
        const vd = viewDef(ViewFlags.None, [
          elementDef(0, NodeFlags.None, null, null, 1, 'span'),
          textDef(1, null, ['a']),
          elementDef(2, NodeFlags.None, null, null, 1, 'span'),
          textDef(3, null, ['a']),
          textDef(4, null, ['a']),
        ]);

        expect(parents(vd)).toEqual([null, 0, null, 2, null]);
      });
開發者ID:Cammisuli,項目名稱:angular,代碼行數:11,代碼來源:view_def_spec.ts

示例7: it

      it('should calculate parents for multiple levels', () => {
        const vd = viewDef(ViewFlags.None, [
          elementDef(NodeFlags.None, null !, null !, 2, 'span'),
          elementDef(NodeFlags.None, null !, null !, 1, 'span'),
          textDef(null !, ['a']),
          elementDef(NodeFlags.None, null !, null !, 1, 'span'),
          textDef(null !, ['a']),
          textDef(null !, ['a']),
        ]);

        expect(parents(vd)).toEqual([null, 0, 1, null, 3, null]);
      });
開發者ID:DanielKucal,項目名稱:angular,代碼行數:12,代碼來源:view_def_spec.ts


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