diff --git a/packages/compiler/src/render3/r3_identifiers.ts b/packages/compiler/src/render3/r3_identifiers.ts index 80db996ec2..599ec956d8 100644 --- a/packages/compiler/src/render3/r3_identifiers.ts +++ b/packages/compiler/src/render3/r3_identifiers.ts @@ -65,6 +65,7 @@ export class Identifiers { static pipeBindV: o.ExternalReference = {name: 'ɵpbV', moduleName: CORE}; static load: o.ExternalReference = {name: 'ɵld', moduleName: CORE}; + static loadDirective: o.ExternalReference = {name: 'ɵd', moduleName: CORE}; static pipe: o.ExternalReference = {name: 'ɵPp', moduleName: CORE}; diff --git a/packages/compiler/src/render3/view/compiler.ts b/packages/compiler/src/render3/view/compiler.ts index c43bbec1f2..6075ef0591 100644 --- a/packages/compiler/src/render3/view/compiler.ts +++ b/packages/compiler/src/render3/view/compiler.ts @@ -359,8 +359,8 @@ function createHostBindingsFunction( for (let index = 0; index < meta.queries.length; index++) { const query = meta.queries[index]; - // e.g. r3.qR(tmp = r3.ld(dirIndex)[1]) && (r3.ld(dirIndex)[0].someDir = tmp); - const getDirectiveMemory = o.importExpr(R3.load).callFn([o.variable('dirIndex')]); + // e.g. r3.qR(tmp = r3.d(dirIndex)[1]) && (r3.d(dirIndex)[0].someDir = tmp); + const getDirectiveMemory = o.importExpr(R3.loadDirective).callFn([o.variable('dirIndex')]); // The query list is at the query index + 1 because the directive itself is in slot 0. const getQueryList = getDirectiveMemory.key(o.literal(index + 1)); const assignToTemporary = temporary().set(getQueryList); @@ -376,7 +376,7 @@ function createHostBindingsFunction( // Calculate the host property bindings const bindings = bindingParser.createBoundHostProperties(directiveSummary, hostBindingSourceSpan); - const bindingContext = o.importExpr(R3.load).callFn([o.variable('dirIndex')]); + const bindingContext = o.importExpr(R3.loadDirective).callFn([o.variable('dirIndex')]); if (bindings) { for (const binding of bindings) { const bindingExpr = convertPropertyBinding( diff --git a/packages/compiler/test/render3/r3_compiler_compliance_spec.ts b/packages/compiler/test/render3/r3_compiler_compliance_spec.ts index fdea13d17a..8dd56318ab 100644 --- a/packages/compiler/test/render3/r3_compiler_compliance_spec.ts +++ b/packages/compiler/test/render3/r3_compiler_compliance_spec.ts @@ -291,7 +291,7 @@ describe('compiler compliance', () => { factory: function HostBindingDir_Factory() { return new HostBindingDir(); }, hostBindings: function HostBindingDir_HostBindings( dirIndex: $number$, elIndex: $number$) { - $r3$.ɵp(elIndex, 'id', $r3$.ɵb($r3$.ɵld(dirIndex).dirId)); + $r3$.ɵp(elIndex, 'id', $r3$.ɵb($r3$.ɵd(dirIndex).dirId)); } }); `; @@ -823,7 +823,7 @@ describe('compiler compliance', () => { hostBindings: function ContentQueryComponent_HostBindings( dirIndex: $number$, elIndex: $number$) { var $tmp$: $any$; - ($r3$.ɵqR(($tmp$ = $r3$.ɵld(dirIndex)[1])) && ($r3$.ɵld(dirIndex)[0].someDir = $tmp$.first)); + ($r3$.ɵqR(($tmp$ = $r3$.ɵd(dirIndex)[1])) && ($r3$.ɵd(dirIndex)[0].someDir = $tmp$.first)); }, template: function ContentQueryComponent_Template( rf: $RenderFlags$, ctx: $ContentQueryComponent$) {