refactor(ivy): store creationMode in LView.flags (#22417)

PR Close #22417
This commit is contained in:
Kara Erickson
2018-02-20 13:31:31 -08:00
committed by Alex Eagle
parent 930ecacd86
commit e454c5a98e
2 changed files with 14 additions and 7 deletions

View File

@ -25,14 +25,16 @@ import {Renderer3} from './renderer';
*/
export interface LView {
/**
* Whether or not the view is in creationMode.
* Flags for this view.
*
* First bit: Whether or not the view is in creationMode.
*
* This must be stored in the view rather than using `data` as a marker so that
* we can properly support embedded views. Otherwise, when exiting a child view
* back into the parent view, `data` will be defined and `creationMode` will be
* improperly reported as false.
*/
creationMode: boolean;
flags: LViewFlags;
/**
* The parent view is needed when we exit the view and must restore the previous
@ -180,6 +182,11 @@ export interface LView {
queries: LQueries|null;
}
/** Flags associated with an LView (see LView.flags) */
export enum LViewFlags {
CreationMode = 0b001
}
/** Interface necessary to work with view tree traversal */
export interface LViewOrLContainer {
next: LView|LContainer|null;