feat(ivy): support bootstrap in ngModuleDef (#25775)

The bootstrap property of @NgModule was not previously compiled by
the compiler in AOT or JIT modes (in Ivy). This commit adds support
for bootstrap.

PR Close #25775
This commit is contained in:
Alex Rickabaugh
2018-08-28 14:19:33 -07:00
committed by Igor Minar
parent a0c4b2d8f0
commit 13ccdfd89d
4 changed files with 12 additions and 5 deletions

View File

@ -35,7 +35,7 @@ export interface R3NgModuleMetadata {
/**
* An array of expressions representing the bootstrap components specified by the module.
*/
bootstrap: o.Expression[];
bootstrap: R3Reference[];
/**
* An array of expressions representing the directives and pipes declared by the module.
@ -67,7 +67,7 @@ export function compileNgModule(meta: R3NgModuleMetadata): R3NgModuleDef {
const {type: moduleType, bootstrap, declarations, imports, exports} = meta;
const expression = o.importExpr(R3.defineNgModule).callFn([mapToMapExpression({
type: moduleType,
bootstrap: o.literalArr(bootstrap),
bootstrap: o.literalArr(bootstrap.map(ref => ref.value)),
declarations: o.literalArr(declarations.map(ref => ref.value)),
imports: o.literalArr(imports.map(ref => ref.value)),
exports: o.literalArr(exports.map(ref => ref.value)),