diff --git a/packages/core/src/debug/debug_node.ts b/packages/core/src/debug/debug_node.ts index ac2b3a05a0..09580ffbcd 100644 --- a/packages/core/src/debug/debug_node.ts +++ b/packages/core/src/debug/debug_node.ts @@ -11,16 +11,19 @@ import {getViewComponent} from '../render3/global_utils_api'; import {CONTAINER_HEADER_OFFSET, LContainer, NATIVE} from '../render3/interfaces/container'; import {TElementNode, TNode, TNodeFlags, TNodeType} from '../render3/interfaces/node'; import {StylingIndex} from '../render3/interfaces/styling'; +import {isComponent, isLContainer} from '../render3/interfaces/type_checks'; import {LView, PARENT, TData, TVIEW, T_HOST} from '../render3/interfaces/view'; import {getProp, getValue, isClassBasedValue} from '../render3/styling/class_and_style_bindings'; import {getStylingContextFromLView} from '../render3/styling/util'; import {getComponent, getContext, getInjectionTokens, getInjector, getListeners, getLocalRefs, isBrowserEvents, loadLContext, loadLContextFromNode} from '../render3/util/discovery_utils'; import {INTERPOLATION_DELIMITER, isPropMetadataString, renderStringify} from '../render3/util/misc_utils'; import {findComponentView} from '../render3/util/view_traversal_utils'; -import {getComponentViewByIndex, getNativeByTNodeOrNull, isComponent, isLContainer} from '../render3/util/view_utils'; +import {getComponentViewByIndex, getNativeByTNodeOrNull} from '../render3/util/view_utils'; import {assertDomNode} from '../util/assert'; import {DebugContext} from '../view/index'; + + /** * @publicApi */ diff --git a/packages/core/src/render3/assert.ts b/packages/core/src/render3/assert.ts index 8f1e59eb1c..18a44d0e29 100644 --- a/packages/core/src/render3/assert.ts +++ b/packages/core/src/render3/assert.ts @@ -10,8 +10,8 @@ import {assertDefined, assertEqual, throwError} from '../util/assert'; import {getComponentDef, getNgModuleDef} from './definition'; import {TNode} from './interfaces/node'; +import {isLContainer, isLView} from './interfaces/type_checks'; import {LView, TVIEW, TView} from './interfaces/view'; -import {isLContainer, isLView} from './util/view_utils'; export function assertTNodeForLView(tNode: TNode, lView: LView) { tNode.hasOwnProperty('tView_') && assertEqual( diff --git a/packages/core/src/render3/di.ts b/packages/core/src/render3/di.ts index d5a1a2ef51..ea28825677 100644 --- a/packages/core/src/render3/di.ts +++ b/packages/core/src/render3/di.ts @@ -18,6 +18,7 @@ import {NG_ELEMENT_ID} from './fields'; import {DirectiveDef, FactoryFn} from './interfaces/definition'; import {NO_PARENT_INJECTOR, NodeInjectorFactory, PARENT_INJECTOR, RelativeInjectorLocation, RelativeInjectorLocationFlags, TNODE, isFactory} from './interfaces/injector'; import {AttributeMarker, TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeFlags, TNodeProviderIndexes, TNodeType} from './interfaces/node'; +import {isComponent, isComponentDef} from './interfaces/type_checks'; import {DECLARATION_VIEW, INJECTOR, LView, TData, TVIEW, TView, T_HOST} from './interfaces/view'; import {assertNodeOfPossibleTypes} from './node_assert'; import {getLView, getPreviousOrParentTNode, setTNodeAndViewData} from './state'; @@ -25,7 +26,6 @@ import {isNameOnlyAttributeMarker} from './util/attrs_utils'; import {getParentInjectorIndex, getParentInjectorView, hasParentInjector} from './util/injector_utils'; import {stringifyForError} from './util/misc_utils'; import {findComponentView} from './util/view_traversal_utils'; -import {isComponent, isComponentDef} from './util/view_utils'; diff --git a/packages/core/src/render3/di_setup.ts b/packages/core/src/render3/di_setup.ts index f0b7ef43b8..7540090cba 100644 --- a/packages/core/src/render3/di_setup.ts +++ b/packages/core/src/render3/di_setup.ts @@ -16,9 +16,9 @@ import {ɵɵdirectiveInject} from './instructions/all'; import {DirectiveDef} from './interfaces/definition'; import {NodeInjectorFactory} from './interfaces/injector'; import {TContainerNode, TElementContainerNode, TElementNode, TNodeProviderIndexes} from './interfaces/node'; +import {isComponentDef} from './interfaces/type_checks'; import {LView, TData, TVIEW, TView} from './interfaces/view'; import {getLView, getPreviousOrParentTNode} from './state'; -import {isComponentDef} from './util/view_utils'; diff --git a/packages/core/src/render3/features/inherit_definition_feature.ts b/packages/core/src/render3/features/inherit_definition_feature.ts index 441af1e386..4d32bfdf12 100644 --- a/packages/core/src/render3/features/inherit_definition_feature.ts +++ b/packages/core/src/render3/features/inherit_definition_feature.ts @@ -10,8 +10,8 @@ import {Type} from '../../interface/type'; import {fillProperties} from '../../util/property'; import {EMPTY_ARRAY, EMPTY_OBJ} from '../empty'; import {ComponentDef, ContentQueriesFunction, DirectiveDef, DirectiveDefFeature, HostBindingsFunction, RenderFlags, ViewQueriesFunction} from '../interfaces/definition'; +import {isComponentDef} from '../interfaces/type_checks'; import {adjustActiveDirectiveSuperClassDepthPosition} from '../state'; -import {isComponentDef} from '../util/view_utils'; import {ɵɵNgOnChangesFeature} from './ng_onchanges_feature'; diff --git a/packages/core/src/render3/i18n.ts b/packages/core/src/render3/i18n.ts index 2a328885b3..70fa75d728 100644 --- a/packages/core/src/render3/i18n.ts +++ b/packages/core/src/render3/i18n.ts @@ -25,13 +25,14 @@ import {TElementNode, TIcuContainerNode, TNode, TNodeFlags, TNodeType, TProjecti import {RComment, RElement, RText} from './interfaces/renderer'; import {SanitizerFn} from './interfaces/sanitization'; import {StylingContext} from './interfaces/styling'; +import {isLContainer} from './interfaces/type_checks'; import {BINDING_INDEX, HEADER_OFFSET, LView, RENDERER, TVIEW, TView, T_HOST} from './interfaces/view'; import {appendChild, appendProjectedNodes, createTextNode, nativeRemoveNode} from './node_manipulation'; import {getIsParent, getLView, getPreviousOrParentTNode, setIsNotParent, setPreviousOrParentTNode} from './state'; import {NO_CHANGE} from './tokens'; import {renderStringify} from './util/misc_utils'; import {findComponentView} from './util/view_traversal_utils'; -import {getNativeByIndex, getNativeByTNode, getTNode, isLContainer} from './util/view_utils'; +import {getNativeByIndex, getNativeByTNode, getTNode} from './util/view_utils'; const MARKER = `�`; diff --git a/packages/core/src/render3/instructions/lview_debug.ts b/packages/core/src/render3/instructions/lview_debug.ts index f25ac583ff..b39230184f 100644 --- a/packages/core/src/render3/instructions/lview_debug.ts +++ b/packages/core/src/render3/instructions/lview_debug.ts @@ -18,12 +18,13 @@ import {SelectorFlags} from '../interfaces/projection'; import {LQueries} from '../interfaces/query'; import {RComment, RElement, RNode} from '../interfaces/renderer'; import {StylingContext} from '../interfaces/styling'; +import {isStylingContext} from '../interfaces/type_checks'; import {BINDING_INDEX, CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTENT_QUERIES, CONTEXT, DECLARATION_VIEW, ExpandoInstructions, FLAGS, HEADER_OFFSET, HOST, HookData, INJECTOR, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, RENDERER_FACTORY, SANITIZER, TData, TVIEW, TView as ITView, TView, T_HOST} from '../interfaces/view'; import {TStylingContext} from '../styling_next/interfaces'; import {runtimeIsNewStylingInUse} from '../styling_next/state'; import {DebugStyling as DebugNewStyling, NodeStylingDebug} from '../styling_next/styling_debug'; import {attachDebugObject} from '../util/debug_utils'; -import {getTNode, isStylingContext, unwrapRNode} from '../util/view_utils'; +import {getTNode, unwrapRNode} from '../util/view_utils'; /* diff --git a/packages/core/src/render3/instructions/shared.ts b/packages/core/src/render3/instructions/shared.ts index e68769afeb..5c58bc5f55 100644 --- a/packages/core/src/render3/instructions/shared.ts +++ b/packages/core/src/render3/instructions/shared.ts @@ -27,6 +27,7 @@ import {LQueries} from '../interfaces/query'; import {RComment, RElement, RText, Renderer3, RendererFactory3, isProceduralRenderer} from '../interfaces/renderer'; import {SanitizerFn} from '../interfaces/sanitization'; import {StylingContext} from '../interfaces/styling'; +import {isComponent, isComponentDef, isContentQueryHost, isLContainer, isRootView} from '../interfaces/type_checks'; import {BINDING_INDEX, CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTEXT, DECLARATION_VIEW, ExpandoInstructions, FLAGS, HEADER_OFFSET, HOST, INJECTOR, InitPhaseState, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, RENDERER_FACTORY, RootContext, RootContextFlags, SANITIZER, TData, TVIEW, TView, T_HOST} from '../interfaces/view'; import {assertNodeOfPossibleTypes, assertNodeType} from '../node_assert'; import {isNodeMatchingSelectorList} from '../node_selector_matcher'; @@ -37,7 +38,8 @@ import {NO_CHANGE} from '../tokens'; import {attrsStylingIndexOf} from '../util/attrs_utils'; import {INTERPOLATION_DELIMITER, renderStringify, stringifyForError} from '../util/misc_utils'; import {getLViewParent, getRootContext} from '../util/view_traversal_utils'; -import {getComponentViewByIndex, getNativeByIndex, getNativeByTNode, getTNode, isComponent, isComponentDef, isContentQueryHost, isLContainer, isRootView, readPatchedLView, resetPreOrderHookFlags, unwrapRNode, viewAttachedToChangeDetector} from '../util/view_utils'; +import {getComponentViewByIndex, getNativeByIndex, getNativeByTNode, getTNode, readPatchedLView, resetPreOrderHookFlags, unwrapRNode, viewAttachedToChangeDetector} from '../util/view_utils'; + import {LCleanup, LViewBlueprint, MatchesArray, TCleanup, TNodeConstructor, TNodeInitialData, TNodeInitialInputs, TNodeLocalNames, TViewComponents, TViewConstructor, attachLContainerDebug, attachLViewDebug, cloneToLView, cloneToTViewData} from './lview_debug'; import {selectInternal} from './select'; diff --git a/packages/core/src/render3/interfaces/type_checks.ts b/packages/core/src/render3/interfaces/type_checks.ts new file mode 100644 index 0000000000..d78237d863 --- /dev/null +++ b/packages/core/src/render3/interfaces/type_checks.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import {ComponentDef, DirectiveDef} from '..'; + +import {LContainer, TYPE} from './container'; +import {TNode, TNodeFlags} from './node'; +import {RNode} from './renderer'; +import {StylingContext} from './styling'; +import {FLAGS, LView, LViewFlags} from './view'; + + +/** +* True if `value` is `LView`. +* @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext` +*/ +export function isLView(value: RNode | LView | LContainer | StylingContext | {} | null): + value is LView { + return Array.isArray(value) && typeof value[TYPE] === 'object'; +} + +/** + * True if `value` is `LContainer`. + * @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext` + */ +export function isLContainer(value: RNode | LView | LContainer | StylingContext | {} | null): + value is LContainer { + return Array.isArray(value) && value[TYPE] === true; +} + +/** + * True if `value` is `StylingContext`. + * @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext` + */ +export function isStylingContext(value: RNode | LView | LContainer | StylingContext | {} | null): + value is StylingContext { + return Array.isArray(value) && typeof value[TYPE] === 'number'; +} + +export function isContentQueryHost(tNode: TNode): boolean { + return (tNode.flags & TNodeFlags.hasContentQuery) !== 0; +} + +export function isComponent(tNode: TNode): boolean { + return (tNode.flags & TNodeFlags.isComponent) === TNodeFlags.isComponent; +} + +export function isComponentDef(def: DirectiveDef): def is ComponentDef { + return (def as ComponentDef).template !== null; +} + +export function isRootView(target: LView): boolean { + return (target[FLAGS] & LViewFlags.IsRoot) !== 0; +} diff --git a/packages/core/src/render3/node_manipulation.ts b/packages/core/src/render3/node_manipulation.ts index 951c81d5bd..9336edc656 100644 --- a/packages/core/src/render3/node_manipulation.ts +++ b/packages/core/src/render3/node_manipulation.ts @@ -18,11 +18,12 @@ import {TElementContainerNode, TElementNode, TIcuContainerNode, TNode, TNodeFlag import {unusedValueExportToPlacateAjd as unused3} from './interfaces/projection'; import {ProceduralRenderer3, RElement, RNode, RText, Renderer3, isProceduralRenderer, unusedValueExportToPlacateAjd as unused4} from './interfaces/renderer'; import {StylingContext} from './interfaces/styling'; +import {isLContainer, isLView, isRootView} from './interfaces/type_checks'; import {CHILD_HEAD, CLEANUP, FLAGS, HOST, HookData, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, TVIEW, T_HOST, unusedValueExportToPlacateAjd as unused5} from './interfaces/view'; import {assertNodeOfPossibleTypes, assertNodeType} from './node_assert'; import {renderStringify} from './util/misc_utils'; import {findComponentView, getLViewParent} from './util/view_traversal_utils'; -import {getNativeByTNode, getNativeByTNodeOrNull, isLContainer, isLView, isRootView, unwrapRNode, viewAttachedToContainer} from './util/view_utils'; +import {getNativeByTNode, getNativeByTNodeOrNull, unwrapRNode, viewAttachedToContainer} from './util/view_utils'; const unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4 + unused5; diff --git a/packages/core/src/render3/query.ts b/packages/core/src/render3/query.ts index a9d914e030..dc31625f1b 100644 --- a/packages/core/src/render3/query.ts +++ b/packages/core/src/render3/query.ts @@ -24,9 +24,10 @@ import {unusedValueExportToPlacateAjd as unused1} from './interfaces/definition' import {unusedValueExportToPlacateAjd as unused2} from './interfaces/injector'; import {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType, unusedValueExportToPlacateAjd as unused3} from './interfaces/node'; import {LQueries, unusedValueExportToPlacateAjd as unused4} from './interfaces/query'; +import {isContentQueryHost} from './interfaces/type_checks'; import {CONTENT_QUERIES, HEADER_OFFSET, LView, QUERIES, TVIEW, TView} from './interfaces/view'; import {getCurrentQueryIndex, getIsParent, getLView, getPreviousOrParentTNode, isCreationMode, setCurrentQueryIndex} from './state'; -import {isContentQueryHost, loadInternal} from './util/view_utils'; +import {loadInternal} from './util/view_utils'; import {createElementRef, createTemplateRef} from './view_engine_compatibility'; const unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4; diff --git a/packages/core/src/render3/styling/util.ts b/packages/core/src/render3/styling/util.ts index 8f302b584d..d5afb98a0b 100644 --- a/packages/core/src/render3/styling/util.ts +++ b/packages/core/src/render3/styling/util.ts @@ -11,12 +11,13 @@ import {StyleSanitizeFn} from '../../sanitization/style_sanitizer'; import {getLContext} from '../context_discovery'; import {LContainer} from '../interfaces/container'; import {LContext} from '../interfaces/context'; -import {AttributeMarker, TAttributes, TNode, TNodeFlags} from '../interfaces/node'; +import {TNode, TNodeFlags} from '../interfaces/node'; import {PlayState, Player, PlayerContext, PlayerIndex} from '../interfaces/player'; import {RElement} from '../interfaces/renderer'; import {DirectiveRegistryValuesIndex, InitialStylingValues, StylingContext, StylingFlags, StylingIndex} from '../interfaces/styling'; +import {isStylingContext} from '../interfaces/type_checks'; import {HEADER_OFFSET, HOST, LView, RootContext} from '../interfaces/view'; -import {getTNode, isStylingContext} from '../util/view_utils'; +import {getTNode} from '../util/view_utils'; import {CorePlayerHandler} from './core_player_handler'; import {DEFAULT_TEMPLATE_DIRECTIVE_INDEX} from './shared'; diff --git a/packages/core/src/render3/styling_next/instructions.ts b/packages/core/src/render3/styling_next/instructions.ts index f565579a2b..99c40b7b7a 100644 --- a/packages/core/src/render3/styling_next/instructions.ts +++ b/packages/core/src/render3/styling_next/instructions.ts @@ -11,16 +11,17 @@ import {LContainer} from '../interfaces/container'; import {AttributeMarker, TAttributes, TNode, TNodeType} from '../interfaces/node'; import {RElement} from '../interfaces/renderer'; import {StylingContext as OldStylingContext, StylingIndex as OldStylingIndex} from '../interfaces/styling'; -import {BINDING_INDEX, HEADER_OFFSET, HOST, LView, RENDERER, SANITIZER} from '../interfaces/view'; +import {isStylingContext as isOldStylingContext} from '../interfaces/type_checks'; +import {BINDING_INDEX, HEADER_OFFSET, HOST, LView, RENDERER} from '../interfaces/view'; import {getActiveDirectiveId, getActiveDirectiveSuperClassDepth, getActiveDirectiveSuperClassHeight, getLView, getSelectedIndex} from '../state'; import {NO_CHANGE} from '../tokens'; import {renderStringify} from '../util/misc_utils'; -import {getTNode, isStylingContext as isOldStylingContext} from '../util/view_utils'; +import {getTNode} from '../util/view_utils'; import {applyClasses, applyStyles, registerBinding, updateClassBinding, updateStyleBinding} from './bindings'; import {TStylingContext} from './interfaces'; import {activeStylingMapFeature, normalizeIntoStylingMap} from './map_based_bindings'; -import {getCurrentStyleSanitizer, setCurrentStyleSanitizer} from './state'; +import {setCurrentStyleSanitizer} from './state'; import {attachStylingDebugObject} from './styling_debug'; import {allocTStylingContext, getCurrentOrLViewSanitizer, hasValueChanged, updateContextDirectiveIndex} from './util'; diff --git a/packages/core/src/render3/util/discovery_utils.ts b/packages/core/src/render3/util/discovery_utils.ts index 60c6cf90e3..6a25316952 100644 --- a/packages/core/src/render3/util/discovery_utils.ts +++ b/packages/core/src/render3/util/discovery_utils.ts @@ -7,7 +7,6 @@ */ import {Injector} from '../../di/injector'; - import {assertLView} from '../assert'; import {discoverLocalRefs, getComponentAtNodeIndex, getDirectivesAtNodeIndex, getLContext} from '../context_discovery'; import {NodeInjector} from '../di'; @@ -15,6 +14,7 @@ import {LContext} from '../interfaces/context'; import {DirectiveDef} from '../interfaces/definition'; import {TElementNode, TNode, TNodeProviderIndexes} from '../interfaces/node'; import {CLEANUP, CONTEXT, FLAGS, HOST, LView, LViewFlags, TVIEW} from '../interfaces/view'; + import {stringifyForError} from './misc_utils'; import {getLViewParent, getRootContext} from './view_traversal_utils'; import {unwrapRNode} from './view_utils'; diff --git a/packages/core/src/render3/util/view_traversal_utils.ts b/packages/core/src/render3/util/view_traversal_utils.ts index 7e9af42899..68947854cc 100644 --- a/packages/core/src/render3/util/view_traversal_utils.ts +++ b/packages/core/src/render3/util/view_traversal_utils.ts @@ -9,9 +9,11 @@ import {assertDefined} from '../../util/assert'; import {assertLView} from '../assert'; import {TNodeType} from '../interfaces/node'; +import {isLContainer, isLView} from '../interfaces/type_checks'; import {CONTEXT, DECLARATION_VIEW, FLAGS, LView, LViewFlags, PARENT, RootContext, T_HOST} from '../interfaces/view'; -import {isLContainer, isLView, readPatchedLView} from './view_utils'; +import {readPatchedLView} from './view_utils'; + /** diff --git a/packages/core/src/render3/util/view_utils.ts b/packages/core/src/render3/util/view_utils.ts index 1c570485bd..67d37015f1 100644 --- a/packages/core/src/render3/util/view_utils.ts +++ b/packages/core/src/render3/util/view_utils.ts @@ -6,15 +6,15 @@ * found in the LICENSE file at https://angular.io/license */ -import {assertDataInRange, assertDefined, assertDomNode, assertEqual, assertGreaterThan, assertLessThan} from '../../util/assert'; +import {assertDataInRange, assertDefined, assertDomNode, assertGreaterThan, assertLessThan} from '../../util/assert'; import {assertTNodeForLView} from '../assert'; import {LContainer, TYPE} from '../interfaces/container'; import {LContext, MONKEY_PATCH_KEY_NAME} from '../interfaces/context'; -import {ComponentDef, DirectiveDef} from '../interfaces/definition'; -import {TNode, TNodeFlags} from '../interfaces/node'; +import {TNode} from '../interfaces/node'; import {RNode} from '../interfaces/renderer'; import {StylingContext} from '../interfaces/styling'; -import {FLAGS, HEADER_OFFSET, HOST, LView, LViewFlags, PARENT, PREORDER_HOOK_FLAGS, TData, TVIEW, TView} from '../interfaces/view'; +import {isLContainer, isLView} from '../interfaces/type_checks'; +import {FLAGS, HEADER_OFFSET, HOST, LView, LViewFlags, PARENT, PREORDER_HOOK_FLAGS, TData, TVIEW} from '../interfaces/view'; @@ -93,32 +93,6 @@ export function unwrapStylingContext(value: RNode | LView | LContainer | Styling return null; } -/** - * True if `value` is `LView`. - * @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext` - */ -export function isLView(value: RNode | LView | LContainer | StylingContext | {} | null): - value is LView { - return Array.isArray(value) && typeof value[TYPE] === 'object'; -} - -/** - * True if `value` is `LContainer`. - * @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext` - */ -export function isLContainer(value: RNode | LView | LContainer | StylingContext | {} | null): - value is LContainer { - return Array.isArray(value) && value[TYPE] === true; -} - -/** - * True if `value` is `StylingContext`. - * @param value wrapped value of `RNode`, `LView`, `LContainer`, `StylingContext` - */ -export function isStylingContext(value: RNode | LView | LContainer | StylingContext | {} | null): - value is StylingContext { - return Array.isArray(value) && typeof value[TYPE] === 'number'; -} /** * Retrieves an element value from the provided `viewData`, by unwrapping @@ -187,21 +161,6 @@ export function getComponentViewByIndex(nodeIndex: number, hostView: LView): LVi return lView; } -export function isContentQueryHost(tNode: TNode): boolean { - return (tNode.flags & TNodeFlags.hasContentQuery) !== 0; -} - -export function isComponent(tNode: TNode): boolean { - return (tNode.flags & TNodeFlags.isComponent) === TNodeFlags.isComponent; -} - -export function isComponentDef(def: DirectiveDef): def is ComponentDef { - return (def as ComponentDef).template !== null; -} - -export function isRootView(target: LView): boolean { - return (target[FLAGS] & LViewFlags.IsRoot) !== 0; -} /** * Returns the monkey-patch value data present on the target (which could be diff --git a/packages/core/src/render3/view_engine_compatibility.ts b/packages/core/src/render3/view_engine_compatibility.ts index d7a06ed835..3355d8741c 100644 --- a/packages/core/src/render3/view_engine_compatibility.ts +++ b/packages/core/src/render3/view_engine_compatibility.ts @@ -22,6 +22,7 @@ import {addToViewTree, createEmbeddedViewAndNode, createLContainer, renderEmbedd import {ACTIVE_INDEX, CONTAINER_HEADER_OFFSET, LContainer, VIEW_REFS} from './interfaces/container'; import {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType, TViewNode} from './interfaces/node'; import {RComment, RElement, isProceduralRenderer} from './interfaces/renderer'; +import {isComponent, isLContainer, isLView, isRootView} from './interfaces/type_checks'; import {CONTEXT, LView, QUERIES, RENDERER, TView, T_HOST} from './interfaces/view'; import {assertNodeOfPossibleTypes} from './node_assert'; import {addRemoveViewFromContainer, appendChild, detachView, getBeforeNodeForView, insertView, nativeInsertBefore, nativeNextSibling, nativeParentNode, removeView} from './node_manipulation'; @@ -29,7 +30,7 @@ import {getParentInjectorTNode} from './node_util'; import {getLView, getPreviousOrParentTNode} from './state'; import {getParentInjectorView, hasParentInjector} from './util/injector_utils'; import {findComponentView} from './util/view_traversal_utils'; -import {getComponentViewByIndex, getNativeByTNode, isComponent, isLContainer, isLView, isRootView, unwrapRNode, viewAttachedToContainer} from './util/view_utils'; +import {getComponentViewByIndex, getNativeByTNode, unwrapRNode, viewAttachedToContainer} from './util/view_utils'; import {ViewRef} from './view_ref'; diff --git a/packages/core/test/render3/view_utils_spec.ts b/packages/core/test/render3/view_utils_spec.ts index 6526a33836..73cd3c0b29 100644 --- a/packages/core/test/render3/view_utils_spec.ts +++ b/packages/core/test/render3/view_utils_spec.ts @@ -7,8 +7,9 @@ */ import {createLContainer, createLView, createTNode, createTView} from '@angular/core/src/render3/instructions/shared'; +import {isLContainer, isLView, isStylingContext} from '@angular/core/src/render3/interfaces/type_checks'; import {createEmptyStylingContext} from '@angular/core/src/render3/styling/util'; -import {isLContainer, isLView, isStylingContext, unwrapLContainer, unwrapLView, unwrapRNode, unwrapStylingContext} from '@angular/core/src/render3/util/view_utils'; +import {unwrapLContainer, unwrapLView, unwrapRNode, unwrapStylingContext} from '@angular/core/src/render3/util/view_utils'; describe('view_utils', () => { it('should verify unwrap methods', () => {