diff --git a/packages/core/src/render3/di.ts b/packages/core/src/render3/di.ts index f7b4043d27..d2284c7194 100644 --- a/packages/core/src/render3/di.ts +++ b/packages/core/src/render3/di.ts @@ -203,7 +203,8 @@ export function getInjectorIndex(tNode: TNode, lView: LView): number { * Finds the index of the parent injector, with a view offset if applicable. Used to set the * parent injector initially. * - * Returns a combination of number of `LView` we have to go up and index in that `LView` + * @returns Returns a number that is the combination of the number of LViews that we have to go up + * to find the LView containing the parent inject AND the index of the injector within that LView. */ export function getParentInjectorLocation(tNode: TNode, lView: LView): RelativeInjectorLocation { if (tNode.parent && tNode.parent.injectorIndex !== -1) { @@ -227,8 +228,9 @@ export function getParentInjectorLocation(tNode: TNode, lView: LView): RelativeI const tView = lViewCursor[TVIEW]; const tViewType = tView.type; if (tViewType === TViewType.Embedded) { - ngDevMode && assertDefined(tView.node, 'Embedded TNodes should have declaration parents.'); - parentTNode = tView.node; + ngDevMode && + assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.'); + parentTNode = tView.declTNode; } else if (tViewType === TViewType.Component) { // Components don't have `TView.declTNode` because each instance of component could be // inserted in different location, hence `TView.declTNode` is meaningless. @@ -255,7 +257,6 @@ export function getParentInjectorLocation(tNode: TNode, lView: LView): RelativeI } return NO_PARENT_INJECTOR; } - /** * Makes a type or an injection token public to the DI system by adding it to an * injector's bloom filter. diff --git a/packages/core/src/render3/instructions/lview_debug.ts b/packages/core/src/render3/instructions/lview_debug.ts index 4a71170491..d7f47afaa9 100644 --- a/packages/core/src/render3/instructions/lview_debug.ts +++ b/packages/core/src/render3/instructions/lview_debug.ts @@ -120,7 +120,7 @@ export const TViewConstructor = class TView implements ITView { public template: ComponentTemplate<{}>|null, // public queries: TQueries|null, // public viewQuery: ViewQueriesFunction<{}>|null, // - public node: ITNode|null, // + public declTNode: ITNode|null, // public data: TData, // public bindingStartIndex: number, // public expandoStartIndex: number, // diff --git a/packages/core/src/render3/instructions/shared.ts b/packages/core/src/render3/instructions/shared.ts index 0bab24b511..ef8c33973c 100644 --- a/packages/core/src/render3/instructions/shared.ts +++ b/packages/core/src/render3/instructions/shared.ts @@ -179,7 +179,7 @@ export function createLView( lView[HOST] = host; lView[FLAGS] = flags | LViewFlags.CreationMode | LViewFlags.Attached | LViewFlags.FirstLViewPass; resetPreOrderHookFlags(lView); - ngDevMode && tView.node && parentLView && assertTNodeForLView(tView.node, parentLView); + ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView); lView[PARENT] = lView[DECLARATION_VIEW] = parentLView; lView[CONTEXT] = context; lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY])!; @@ -682,7 +682,7 @@ export function createTView( template: templateFn, queries: null, viewQuery: viewQuery, - node: declTNode, + declTNode: declTNode, data: blueprint.slice().fill(null, bindingStartIndex), bindingStartIndex: bindingStartIndex, expandoStartIndex: initialViewLength, diff --git a/packages/core/src/render3/interfaces/view.ts b/packages/core/src/render3/interfaces/view.ts index b6369284b5..504bb542dd 100644 --- a/packages/core/src/render3/interfaces/view.ts +++ b/packages/core/src/render3/interfaces/view.ts @@ -499,8 +499,7 @@ export interface TView { /** * A `TNode` representing the declaration location of this `TView` (not part of this TView). */ - // FIXME(misko): Rename `node` to `declTNode` - node: TNode|null; + declTNode: TNode|null; // FIXME(misko): Why does `TView` not have `declarationTView` property? diff --git a/packages/core/src/render3/view_engine_compatibility.ts b/packages/core/src/render3/view_engine_compatibility.ts index 6d267c87ba..bd2dec3498 100644 --- a/packages/core/src/render3/view_engine_compatibility.ts +++ b/packages/core/src/render3/view_engine_compatibility.ts @@ -106,7 +106,7 @@ export function createTemplateRef( const embeddedTView = this._declarationTContainer.tViews as TView; const embeddedLView = createLView( this._declarationView, embeddedTView, context, LViewFlags.CheckAlways, null, - embeddedTView.node, null, null, null, null); + embeddedTView.declTNode, null, null, null, null); const declarationLContainer = this._declarationView[this._declarationTContainer.index]; ngDevMode && assertLContainer(declarationLContainer); diff --git a/packages/core/test/render3/is_shape_of.ts b/packages/core/test/render3/is_shape_of.ts index 7096136f55..554a3ade6b 100644 --- a/packages/core/test/render3/is_shape_of.ts +++ b/packages/core/test/render3/is_shape_of.ts @@ -94,7 +94,7 @@ const ShapeOfTView: ShapeOf = { blueprint: true, template: true, viewQuery: true, - node: true, + declTNode: true, firstCreatePass: true, firstUpdatePass: true, data: true,