fix(ivy): support schemas at runtime (#28637)

Accounts for schemas in when validating properties in Ivy.

This PR resolves FW-819.

A couple of notes:
* I had to rework the test slightly, in order to have it fail when we expect it to. The one in master is passing since Ivy's validation runs during the update phase, rather than creation.
* I had to deviate from the design in FW-819 and not add an `enableSchema` instruction, because the schema is part of the `NgModule` scope, however the scope is only assigned to a component once all of the module's declarations have been resolved and some of them can be async. Instead, I opted to have the `schemas` on the component definition.

PR Close #28637
This commit is contained in:
Kristiyan Kostadinov
2019-02-12 00:03:04 +01:00
committed by Miško Hevery
parent 7cbc36fdac
commit 80a5934af6
18 changed files with 162 additions and 76 deletions

View File

@ -134,6 +134,8 @@ export class NgModuleDecoratorHandler implements DecoratorHandler<NgModuleAnalys
exports: exports.map(exp => this._toR3Reference(exp, valueContext, typeContext)),
imports: imports.map(imp => this._toR3Reference(imp, valueContext, typeContext)),
emitInline: false,
// TODO: to be implemented as a part of FW-1004.
schemas: [],
};
const providers: Expression = ngModule.has('providers') ?