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


TypeScript index.viewDef函數代碼示例

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


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

示例1: it

      it('should calculate childFlags for two levels', () => {
        const vd = viewDef(ViewFlags.None, [
          elementDef(NodeFlags.None, null !, null !, 2, 'span'),
          elementDef(NodeFlags.None, null !, null !, 1, 'span'),
          directiveDef(NodeFlags.AfterContentChecked, null !, 0, AService, [])
        ]);

        expect(childFlags(vd)).toEqual([
          NodeFlags.TypeElement | NodeFlags.TypeDirective | NodeFlags.AfterContentChecked,
          NodeFlags.TypeDirective | NodeFlags.AfterContentChecked, NodeFlags.None
        ]);

        expect(directChildFlags(vd)).toEqual([
          NodeFlags.TypeElement, NodeFlags.TypeDirective | NodeFlags.AfterContentChecked,
          NodeFlags.None
        ]);
      });
開發者ID:DanielKucal,項目名稱:angular,代碼行數:17,代碼來源:view_def_spec.ts

示例2: it

      it('should calculate childFlags for one level, multiple roots', () => {
        const vd = viewDef(ViewFlags.None, [
          elementDef(NodeFlags.None, null, null, 1, 'span'),
          directiveDef(NodeFlags.AfterContentChecked, null, 0, AService, []),
          elementDef(NodeFlags.None, null, null, 2, 'span'),
          directiveDef(NodeFlags.AfterContentInit, null, 0, AService, []),
          directiveDef(NodeFlags.AfterViewChecked, null, 0, AService, []),
        ]);

        expect(childFlags(vd)).toEqual([
          NodeFlags.TypeDirective | NodeFlags.AfterContentChecked, NodeFlags.None,
          NodeFlags.TypeDirective | NodeFlags.AfterContentInit | NodeFlags.AfterViewChecked,
          NodeFlags.None, NodeFlags.None
        ]);

        expect(directChildFlags(vd)).toEqual([
          NodeFlags.TypeDirective | NodeFlags.AfterContentChecked, NodeFlags.None,
          NodeFlags.TypeDirective | NodeFlags.AfterContentInit | NodeFlags.AfterViewChecked,
          NodeFlags.None, NodeFlags.None
        ]);
      });
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:21,代碼來源:view_def_spec.ts

示例3: return

 return () => viewDef(ViewFlags.None, nodes, update);
開發者ID:ballipongala,項目名稱:angular,代碼行數:1,代碼來源:query_spec.ts

示例4: compViewDef

 function compViewDef(
     nodes: NodeDef[], updateDirectives?: ViewUpdateFn, updateRenderer?: ViewUpdateFn,
     viewFlags: ViewFlags = ViewFlags.None): ViewDefinition {
   return viewDef(viewFlags, nodes, updateDirectives, updateRenderer);
 }
開發者ID:ballipongala,項目名稱:angular,代碼行數:5,代碼來源:query_spec.ts

示例5: viewDef

 () => viewDef(
     ViewFlags.None,
     [
       elementDef(NodeFlags.None, [[1, QueryValueType.Provider]], null, 0, 'span'),
     ]))
開發者ID:JohnnyQQQQ,項目名稱:angular,代碼行數:5,代碼來源:view_def_spec.ts

示例6: compViewDef

 function compViewDef(nodes: NodeDef[], updater?: ViewUpdateFn): ViewDefinition {
   return viewDef(config.viewFlags, nodes, updater, renderComponentType);
 }
開發者ID:JSMike,項目名稱:angular,代碼行數:3,代碼來源:text_spec.ts

示例7: compViewDef

 function compViewDef(
     nodes: NodeDef[], update?: ViewUpdateFn, handleEvent?: ViewHandleEventFn): ViewDefinition {
   return viewDef(ViewFlags.None, nodes, update, handleEvent, renderComponentType);
 }
開發者ID:not-for-me,項目名稱:angular,代碼行數:4,代碼來源:refs_spec.ts

示例8: embeddedViewDef

 function embeddedViewDef(nodes: NodeDef[], update?: ViewUpdateFn): ViewDefinition {
   return viewDef(config.viewFlags, nodes, update);
 }
開發者ID:doxiaodong,項目名稱:angular,代碼行數:3,代碼來源:embedded_view_spec.ts

示例9: compViewDef

 function compViewDef(
     nodes: NodeDef[], updateDirectives?: ViewUpdateFn, updateRenderer?: ViewUpdateFn,
     handleEvent?: ViewHandleEventFn): ViewDefinition {
   return viewDef(ViewFlags.None, nodes, updateDirectives, updateRenderer, handleEvent);
 }
開發者ID:manekinekko,項目名稱:angular,代碼行數:5,代碼來源:anchor_spec.ts

示例10: compViewDef

 function compViewDef(
     nodes: NodeDef[], update?: ViewUpdateFn, handleEvent?: ViewHandleEventFn,
     flags?: ViewFlags): ViewDefinition {
   return viewDef(config.viewFlags | flags, nodes, update, handleEvent, renderComponentType);
 }
開發者ID:doxiaodong,項目名稱:angular,代碼行數:5,代碼來源:component_view_spec.ts


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