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

Function ingestDeferView

packages/compiler/src/template/pipeline/src/ingest.ts:739–766  ·  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

737}
738
739function ingestDeferView(
740 unit: ViewCompilationUnit,
741 suffix: string,
742 i18nMeta: i18n.I18nMeta | undefined,
743 children?: t.Node[],
744 sourceSpan?: ParseSourceSpan,
745): ir.TemplateOp | null {
746 if (i18nMeta !== undefined && !(i18nMeta instanceof i18n.BlockPlaceholder)) {
747 throw Error('Unhandled i18n metadata type for defer block');
748 }
749 if (children === undefined) {
750 return null;
751 }
752 const secondaryView = unit.job.allocateView(unit.xref);
753 ingestNodes(secondaryView, children);
754 const templateOp = ir.createTemplateOp(
755 secondaryView.xref,
756 ir.TemplateKind.Block,
757 null,
758 `Defer${suffix}`,
759 ir.Namespace.HTML,
760 i18nMeta,
761 sourceSpan!,
762 sourceSpan!,
763 );
764 unit.create.push(templateOp);
765 return templateOp;
766}
767
768function ingestDeferBlock(unit: ViewCompilationUnit, deferBlock: t.DeferredBlock): void {
769 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