MCPcopy Create free account
hub / github.com/angular/angular / ingestDeferView

Function ingestDeferView

packages/compiler/src/template/pipeline/src/ingest.ts:623–650  ·  view source on GitHub ↗
(
  unit: ViewCompilationUnit,
  suffix: string,
  i18nMeta: i18n.I18nMeta | undefined,
  children?: t.Node[],
  sourceSpan?: ParseSourceSpan,
)

Source from the content-addressed store, hash-verified

621}
622
623function ingestDeferView(
624 unit: ViewCompilationUnit,
625 suffix: string,
626 i18nMeta: i18n.I18nMeta | undefined,
627 children?: t.Node[],
628 sourceSpan?: ParseSourceSpan,
629): ir.TemplateOp | null {
630 if (i18nMeta !== undefined && !(i18nMeta instanceof i18n.BlockPlaceholder)) {
631 throw Error('Unhandled i18n metadata type for defer block');
632 }
633 if (children === undefined) {
634 return null;
635 }
636 const secondaryView = unit.job.allocateView(unit.xref);
637 ingestNodes(secondaryView, children);
638 const templateOp = ir.createTemplateOp(
639 secondaryView.xref,
640 ir.TemplateKind.Block,
641 null,
642 `Defer${suffix}`,
643 ir.Namespace.HTML,
644 i18nMeta,
645 sourceSpan!,
646 sourceSpan!,
647 );
648 unit.create.push(templateOp);
649 return templateOp;
650}
651
652function ingestDeferBlock(unit: ViewCompilationUnit, deferBlock: t.DeferredBlock): void {
653 let ownResolverFn: o.Expression | null = null;

Callers 1

ingestDeferBlockFunction · 0.85

Calls 4

ErrorInterface · 0.85
ingestNodesFunction · 0.85
allocateViewMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected