feat(core): add NO_ERRORS_SCHEMA that allows any properties to be set on any element (#10956)

Often it is useful to test a component without rendering certain directives/components
in its template because these directives require some complicated setup.

You can do that by using NO_ERRORS_SCHEMA.

TestBed.configureTestingModule({
  schemas: [NO_ERRORS_SCHEMA]
});

This would disable all schema checks in your tests.
This commit is contained in:
Victor Savkin
2016-08-19 16:05:34 -07:00
committed by Kara
parent 53c99cfc95
commit c631cfc2fd
5 changed files with 25 additions and 3 deletions

View File

@ -840,6 +840,9 @@ export declare class NgZone {
static isInAngularZone(): boolean;
}
/** @experimental */
export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
/** @stable */
export declare class NoAnnotationError extends BaseException {
constructor(typeOrFunc: Type<any> | Function, params: any[][]);