refactor(ivy): remove LNode.view (#25988)

PR Close #25988
This commit is contained in:
Kara Erickson
2018-09-17 14:32:45 -07:00
committed by Ben Lesh
parent 5653874683
commit f47f2628e1
14 changed files with 172 additions and 159 deletions

View File

@ -6,12 +6,14 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ChangeDetectorRef} from '../../change_detection/change_detector_ref';
import {ElementRef} from '../../linker/element_ref';
import {TemplateRef} from '../../linker/template_ref';
import {ViewContainerRef} from '../../linker/view_container_ref';
import {LContainerNode, LElementContainerNode, LElementNode, TContainerNode, TElementNode, TNode} from './node';
import {TContainerNode, TElementContainerNode, TElementNode,} from './node';
import {LViewData} from './view';
export interface LInjector {
/**
@ -20,15 +22,14 @@ export interface LInjector {
*/
readonly parent: LInjector|null;
/**
* Allows access to the directives array in that node's static data and to
* the node's flags (for starting directive index and directive size). Necessary
* for DI to retrieve a directive from the data array if injector indicates
* it is there.
*/
readonly node: LElementNode|LElementContainerNode|LContainerNode;
/** Necessary to find directive indices for a particular node and look up the LNode. */
readonly tNode: TElementNode|TElementContainerNode|TContainerNode;
readonly tNode: TNode;
/**
* The view where the node is stored. Necessary because as we traverse up the injector
* tree the view where we search directives may change.
*/
readonly view: LViewData;
/**
* The following bloom filter determines whether a directive is available

View File

@ -81,13 +81,6 @@ export interface LNode {
*/
readonly data: LViewData|LContainer|null;
/**
* Each node belongs to a view.
*
* When the injector is walking up a tree, it needs access to the `directives` (part of view).
*/
readonly view: LViewData;
/** The injector associated with this node. Necessary for DI. */
nodeInjector: LInjector|null;
@ -530,9 +523,9 @@ export type InitialInputs = string[];
export const unusedValueExportToPlacateAjd = 1;
/**
* Type representing a set of LNodes that can have local refs (`#foo`) placed on them.
* Type representing a set of TNodes that can have local refs (`#foo`) placed on them.
*/
export type LNodeWithLocalRefs = LContainerNode | LElementNode | LElementContainerNode;
export type TNodeWithLocalRefs = TContainerNode | TElementNode | TElementContainerNode;
/**
* Type for a function that extracts a value for a local refs.
@ -540,4 +533,4 @@ export type LNodeWithLocalRefs = LContainerNode | LElementNode | LElementContain
* - `<div #nativeDivEl>` - `nativeDivEl` should point to the native `<div>` element;
* - `<ng-template #tplRef>` - `tplRef` should point to the `TemplateRef` instance;
*/
export type LocalRefExtractor = (lNode: LNodeWithLocalRefs, tNode: TNode) => any;
export type LocalRefExtractor = (tNode: TNodeWithLocalRefs, currentView: LViewData) => any;

View File

@ -8,7 +8,7 @@
import {QueryList} from '../../linker';
import {Type} from '../../type';
import {TNode} from './node';
import {TContainerNode, TElementContainerNode, TElementNode, TNode} from './node';
/** Used for tracking queries (e.g. ViewChild, ContentChild). */
export interface LQueries {
@ -33,7 +33,7 @@ export interface LQueries {
* Notify `LQueries` that a new `TNode` has been created and needs to be added to query results
* if matching query predicate.
*/
addNode(tNode: TNode): LQueries|null;
addNode(tNode: TElementNode|TContainerNode|TElementContainerNode): LQueries|null;
/**
* Notify `LQueries` that a new LContainer was added to ivy data structures. As a result we need