MCPcopy Index your code
hub / github.com/angular/angular / parseJitTemplate

Function parseJitTemplate

packages/compiler/src/jit_compiler_facade.ts:787–807  ·  view source on GitHub ↗
(
  template: string,
  typeName: string,
  sourceMapUrl: string,
  preserveWhitespaces: boolean,
  deferBlockDependencies: (() => Promise<unknown> | null)[] | undefined,
)

Source from the content-addressed store, hash-verified

785}
786
787function parseJitTemplate(
788 template: string,
789 typeName: string,
790 sourceMapUrl: string,
791 preserveWhitespaces: boolean,
792 deferBlockDependencies: (() => Promise<unknown> | null)[] | undefined,
793) {
794 // Parse the template and check for errors.
795 const parsed = parseTemplate(template, sourceMapUrl, {preserveWhitespaces});
796 if (parsed.errors !== null) {
797 const errors = parsed.errors.map((err) => err.toString()).join(', ');
798 throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
799 }
800 const binder = new R3TargetBinder(null);
801 const boundTarget = binder.bind({template: parsed.nodes});
802
803 return {
804 template: parsed,
805 defer: createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies),
806 };
807}
808
809/**
810 * Convert the expression, if present to an `R3ProviderExpression`.

Callers 2

compileComponentMethod · 0.85

Calls 6

bindMethod · 0.95
parseTemplateFunction · 0.90
mapMethod · 0.80
joinMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…