diff --git a/packages/compiler/src/render3/view/compiler.ts b/packages/compiler/src/render3/view/compiler.ts index 5ed0079dd79..0849723ea80 100644 --- a/packages/compiler/src/render3/view/compiler.ts +++ b/packages/compiler/src/render3/view/compiler.ts @@ -234,7 +234,7 @@ export function compileComponentFromMetadata( } else { // This path compiles the template using the prototype template pipeline. First the template is // ingested into IR: - const tpl = ingest(meta.name, meta.template.nodes); + const tpl = ingest(meta.name, meta.template.nodes, constantPool); // Then the IR is transformed to prepare it for cod egeneration. transformTemplate(tpl); diff --git a/packages/compiler/src/template/pipeline/src/compilation.ts b/packages/compiler/src/template/pipeline/src/compilation.ts index bb6a7c2b80c..02a8214fb7b 100644 --- a/packages/compiler/src/template/pipeline/src/compilation.ts +++ b/packages/compiler/src/template/pipeline/src/compilation.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ +import {ConstantPool} from '../../../constant_pool'; import * as o from '../../../output/output_ast'; import * as ir from '../ir'; @@ -36,7 +37,7 @@ export class ComponentCompilation { */ readonly root: ViewCompilation; - constructor(readonly componentName: string) { + constructor(readonly componentName: string, readonly pool: ConstantPool) { // Allocate the root view. const root = new ViewCompilation(this, this.allocateXrefId(), null); this.views.set(root.xref, root); diff --git a/packages/compiler/src/template/pipeline/src/ingest.ts b/packages/compiler/src/template/pipeline/src/ingest.ts index 0a202d7ec18..cc70410e715 100644 --- a/packages/compiler/src/template/pipeline/src/ingest.ts +++ b/packages/compiler/src/template/pipeline/src/ingest.ts @@ -6,6 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ +import {ConstantPool} from '../../../constant_pool'; import * as e from '../../../expression_parser/ast'; import * as o from '../../../output/output_ast'; import * as t from '../../../render3/r3_ast'; @@ -18,8 +19,9 @@ import {BINARY_OPERATORS} from './conversion'; * Process a template AST and convert it into a `ComponentCompilation` in the intermediate * representation. */ -export function ingest(componentName: string, template: t.Node[]): ComponentCompilation { - const cpl = new ComponentCompilation(componentName); +export function ingest( + componentName: string, template: t.Node[], constantPool: ConstantPool): ComponentCompilation { + const cpl = new ComponentCompilation(componentName, constantPool); ingestNodes(cpl.root, template); return cpl; }