diff --git a/packages/core/src/render3/index.ts b/packages/core/src/render3/index.ts index 93ab7b96e85..0cc6b79d91e 100644 --- a/packages/core/src/render3/index.ts +++ b/packages/core/src/render3/index.ts @@ -52,7 +52,6 @@ export {ComponentFactory, ComponentFactoryResolver, ComponentRef} from './compon export {ɵɵgetInheritedFactory} from './di'; export {getLocaleId, setLocaleId} from './i18n/i18n_locale_id'; export { - store, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, @@ -230,6 +229,8 @@ export {ɵɵgetComponentDepsFactory} from './local_compilation'; export {ɵsetClassDebugInfo} from './debug/set_debug_info'; export {ɵɵreplaceMetadata} from './hmr'; +export {store} from './util/view_utils'; + export { ComponentDef, ComponentTemplate, diff --git a/packages/core/src/render3/instructions/let_declaration.ts b/packages/core/src/render3/instructions/let_declaration.ts index 77c16a845b0..c821225a30d 100644 --- a/packages/core/src/render3/instructions/let_declaration.ts +++ b/packages/core/src/render3/instructions/let_declaration.ts @@ -12,8 +12,7 @@ import {TNodeType} from '../interfaces/node'; import {HEADER_OFFSET} from '../interfaces/view'; import {getContextLView, getLView, getSelectedIndex, getTView, setCurrentTNode} from '../state'; import {getOrCreateTNode} from '../tnode_manipulation'; -import {load} from '../util/view_utils'; -import {store} from './storage'; +import {load, store} from '../util/view_utils'; /** Object that indicates the value of a `@let` declaration that hasn't been initialized yet. */ const UNINITIALIZED_LET = {}; diff --git a/packages/core/src/render3/instructions/storage.ts b/packages/core/src/render3/instructions/storage.ts index e7ea88238af..ad92a710750 100644 --- a/packages/core/src/render3/instructions/storage.ts +++ b/packages/core/src/render3/instructions/storage.ts @@ -9,17 +9,6 @@ import {HEADER_OFFSET, LView, TView} from '../interfaces/view'; import {getContextLView} from '../state'; import {load} from '../util/view_utils'; -/** Store a value in the `data` at a given `index`. */ -export function store(tView: TView, lView: LView, index: number, value: T): void { - // We don't store any static data for local variables, so the first time - // we see the template, we should store as null to avoid a sparse array - if (index >= tView.data.length) { - tView.data[index] = null; - tView.blueprint[index] = null; - } - lView[index] = value; -} - /** * Retrieves a local reference from the current contextViewData. * diff --git a/packages/core/src/render3/pipe.ts b/packages/core/src/render3/pipe.ts index c16689fa6aa..57a5e58daba 100644 --- a/packages/core/src/render3/pipe.ts +++ b/packages/core/src/render3/pipe.ts @@ -14,7 +14,7 @@ import {Type} from '../interface/type'; import {InjectorProfilerContext, setInjectorProfilerContext} from './debug/injector_profiler'; import {getFactoryDef} from './definition_factory'; import {NodeInjector, setIncludeViewProviders} from './di'; -import {store, ɵɵdirectiveInject} from './instructions/all'; +import {ɵɵdirectiveInject} from './instructions/all'; import {isHostComponentStandalone} from './instructions/element_validation'; import {PipeDef, PipeDefList} from './interfaces/definition'; import {TTextNode} from './interfaces/node'; @@ -27,7 +27,7 @@ import { pureFunctionVInternal, } from './pure_function'; import {getBindingRoot, getCurrentTNode, getLView, getTView} from './state'; -import {load} from './util/view_utils'; +import {load, store} from './util/view_utils'; /** * Create a pipe. diff --git a/packages/core/src/render3/util/view_utils.ts b/packages/core/src/render3/util/view_utils.ts index 901e28a01a0..64592ef5a33 100644 --- a/packages/core/src/render3/util/view_utils.ts +++ b/packages/core/src/render3/util/view_utils.ts @@ -138,6 +138,17 @@ export function load(view: LView | TData, index: number): T { return view[index]; } +/** Store a value in the `data` at a given `index`. */ +export function store(tView: TView, lView: LView, index: number, value: T): void { + // We don't store any static data for local variables, so the first time + // we see the template, we should store as null to avoid a sparse array + if (index >= tView.data.length) { + tView.data[index] = null; + tView.blueprint[index] = null; + } + lView[index] = value; +} + export function getComponentLViewByIndex(nodeIndex: number, hostView: LView): LView { // Could be an LView or an LContainer. If LContainer, unwrap to find LView. ngDevMode && assertIndexInRange(hostView, nodeIndex);