fix(ivy): proper resolution of Enums in Component decorator (#27971)

Prior to this change Component decorator was resolving `encapsulation` value a bit incorrectly, which resulted in `encapsulation: NaN` in compiled code. Now we resolve the value as Enum memeber and throw if it's not the case. As a part of this update, the `changeDetection` field handling is also added, the resolution logic is the same as the one used for `encapsulation` field.

PR Close #27971
This commit is contained in:
Andrew Kushnir
2019-01-07 16:35:06 -08:00
parent 142553abc6
commit c5ab3e8fd2
7 changed files with 122 additions and 13 deletions

View File

@ -64,3 +64,15 @@ export interface SimpleChanges { [propName: string]: any; }
export type ɵNgModuleDefWithMeta<ModuleT, DeclarationsT, ImportsT, ExportsT> = any;
export type ɵDirectiveDefWithMeta<DirT, SelectorT, ExportAsT, InputsT, OutputsT, QueriesT> = any;
export enum ViewEncapsulation {
Emulated = 0,
Native = 1,
None = 2,
ShadowDom = 3
}
export enum ChangeDetectionStrategy {
OnPush = 0,
Default = 1
}