77 */
88
99import { CommonModule } from '@angular/common' ;
10- import { Component , createNgModule , CUSTOM_ELEMENTS_SCHEMA , destroyPlatform , Directive , Injectable , InjectionToken , NgModule , NgModuleRef , NO_ERRORS_SCHEMA , Pipe , ɵsetClassMetadata as setClassMetadata , ɵɵdefineComponent as defineComponent , ɵɵdefineInjector as defineInjector , ɵɵdefineNgModule as defineNgModule , ɵɵelement as element , ɵɵproperty as property } from '@angular/core' ;
10+ import { Component , createNgModule , CUSTOM_ELEMENTS_SCHEMA , destroyPlatform , Directive , Injectable , InjectionToken , NgModule , NgModuleRef , NO_ERRORS_SCHEMA , Pipe , ɵsetClassMetadata as setClassMetadata , ɵɵdefineComponent as defineComponent , ɵɵdefineInjector as defineInjector , ɵɵdefineNgModule as defineNgModule , ɵɵelement as element , ɵɵproperty as property , } from '@angular/core' ;
1111import { KNOWN_CONTROL_FLOW_DIRECTIVES } from '@angular/core/src/render3/instructions/element_validation' ;
1212import { TestBed } from '@angular/core/testing' ;
1313import { BrowserModule } from '@angular/platform-browser' ;
@@ -249,10 +249,10 @@ describe('NgModule', () => {
249249 @Component ( {
250250 selector : 'my-comp' ,
251251 template : `
252- <ng-container *ngIf="condition">
253- <div [unknown-prop]="true"></div>
254- </ng-container>
255- ` ,
252+ <ng-container *ngIf="condition">
253+ <div [unknown-prop]="true"></div>
254+ </ng-container>
255+ ` ,
256256 } )
257257 class MyComp {
258258 condition = true ;
@@ -278,9 +278,7 @@ describe('NgModule', () => {
278278 it ( 'should log an error on unknown props of `ng-template` if NO_ERRORS_SCHEMA is absent' , ( ) => {
279279 @Component ( {
280280 selector : 'my-comp' ,
281- template : `
282- <ng-template *ngIf="condition"></ng-template>
283- ` ,
281+ template : ` <ng-template *ngIf="condition"></ng-template> ` ,
284282 } )
285283 class MyComp {
286284 condition = true ;
@@ -306,9 +304,7 @@ describe('NgModule', () => {
306304 it ( 'should log an error on unknown props of `ng-container` if NO_ERRORS_SCHEMA is absent' , ( ) => {
307305 @Component ( {
308306 selector : 'my-comp' ,
309- template : `
310- <ng-container *ngIf="condition"></ng-container>
311- ` ,
307+ template : ` <ng-container *ngIf="condition"></ng-container> ` ,
312308 } )
313309 class MyComp {
314310 condition = true ;
@@ -334,9 +330,7 @@ describe('NgModule', () => {
334330 it ( 'should log an error on unknown props of `ng-content` if NO_ERRORS_SCHEMA is absent' , ( ) => {
335331 @Component ( {
336332 selector : 'my-comp' ,
337- template : `
338- <ng-content *ngIf="condition"></ng-content>
339- ` ,
333+ template : ` <ng-content *ngIf="condition"></ng-content> ` ,
340334 } )
341335 class MyComp {
342336 condition = true ;
@@ -364,10 +358,10 @@ describe('NgModule', () => {
364358 @Component ( {
365359 selector : 'my-comp' ,
366360 template : `
367- <ng-container *ngIf="condition">
368- <div [unknown-prop]="true"></div>
369- </ng-container>
370- ` ,
361+ <ng-container *ngIf="condition">
362+ <div [unknown-prop]="true"></div>
363+ </ng-container>
364+ ` ,
371365 } )
372366 class MyComp {
373367 condition = true ;
@@ -483,7 +477,7 @@ describe('NgModule', () => {
483477 @Component ( {
484478 template : `<custom-el></custom-el>` ,
485479 standalone : true ,
486- schemas : [ CUSTOM_ELEMENTS_SCHEMA ]
480+ schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
487481 } )
488482 class MyComp {
489483 }
@@ -629,9 +623,9 @@ describe('NgModule', () => {
629623 `NG0303: Can't bind to 'unknownProp' since it isn't a known property of 'may-be-web-component' \\(used in the 'MyComp' component template\\).` ,
630624 `1. If 'may-be-web-component' is an Angular component and it has the 'unknownProp' input, then verify that it is a part of an @NgModule where this component is declared.` ,
631625 `2. If 'may-be-web-component' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.` ,
632- `3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`
626+ `3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.` ,
633627 ] ;
634- lines . forEach ( line => expect ( errorMessage ) . toMatch ( line ) ) ;
628+ lines . forEach ( ( line ) => expect ( errorMessage ) . toMatch ( line ) ) ;
635629 } ) ;
636630
637631 KNOWN_CONTROL_FLOW_DIRECTIVES . forEach ( ( correspondingImport , directive ) => {
@@ -664,9 +658,9 @@ describe('NgModule', () => {
664658 directive } ' since it isn't a known property of 'div' \\(used in the 'App' component template\\).`,
665659 `If the '${ directive } ' is an Angular control flow directive, please make sure ` +
666660 `that either the '${
667- correspondingImport } ' directive or the 'CommonModule' is a part of an @NgModule where this component is declared.`
661+ correspondingImport } ' directive or the 'CommonModule' is a part of an @NgModule where this component is declared.`,
668662 ] ;
669- lines . forEach ( line => expect ( errorMessage ) . toMatch ( line ) ) ;
663+ lines . forEach ( ( line ) => expect ( errorMessage ) . toMatch ( line ) ) ;
670664 } ) ;
671665
672666 it ( `should produce a warning when the '${ directive } ' directive ` +
@@ -692,9 +686,9 @@ describe('NgModule', () => {
692686 directive } ' since it isn't a known property of 'div' \\(used in the 'App' component template\\).`,
693687 `If the '${ directive } ' is an Angular control flow directive, please make sure ` +
694688 `that either the '${
695- correspondingImport } ' directive or the 'CommonModule' is included in the '@Component.imports' of this component.`
689+ correspondingImport } ' directive or the 'CommonModule' is included in the '@Component.imports' of this component.`,
696690 ] ;
697- lines . forEach ( line => expect ( errorMessage ) . toMatch ( line ) ) ;
691+ lines . forEach ( ( line ) => expect ( errorMessage ) . toMatch ( line ) ) ;
698692 } ) ;
699693 } ) ;
700694
@@ -710,16 +704,17 @@ describe('NgModule', () => {
710704 vars,
711705 consts,
712706 template,
713- encapsulation : 2
707+ encapsulation : 2 ,
714708 } ) ;
715709 }
716710 setClassMetadata (
717- Comp , [ {
718- type : Component ,
719- args : [
720- { selector : 'comp' , template : '...' } ,
721- ]
722- } ] ,
711+ Comp ,
712+ [
713+ {
714+ type : Component ,
715+ args : [ { selector : 'comp' , template : '...' } ] ,
716+ } ,
717+ ] ,
723718 null , null ) ;
724719 return Comp ;
725720 }
@@ -730,13 +725,18 @@ describe('NgModule', () => {
730725 static ɵinj = defineInjector ( { } ) ;
731726 }
732727 setClassMetadata (
733- Module , [ {
734- type : NgModule ,
735- args : [ {
736- declarations : [ Comp ] ,
737- schemas : [ NO_ERRORS_SCHEMA ] ,
738- } ]
739- } ] ,
728+ Module ,
729+ [
730+ {
731+ type : NgModule ,
732+ args : [
733+ {
734+ declarations : [ Comp ] ,
735+ schemas : [ NO_ERRORS_SCHEMA ] ,
736+ } ,
737+ ] ,
738+ } ,
739+ ] ,
740740 null , null ) ;
741741 return Module ;
742742 }
@@ -839,7 +839,7 @@ describe('NgModule', () => {
839839 TestBed . configureTestingModule ( {
840840 declarations : [ MyComp ] ,
841841 schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
842- errorOnUnknownElements : true
842+ errorOnUnknownElements : true ,
843843 } ) ;
844844
845845 const fixture = TestBed . createComponent ( MyComp ) ;
@@ -871,8 +871,11 @@ describe('NgModule', () => {
871871 }
872872
873873 const spy = spyOn ( console , 'error' ) ;
874- TestBed . configureTestingModule (
875- { declarations : [ MyComp ] , schemas : [ NO_ERRORS_SCHEMA ] , errorOnUnknownElements : true } ) ;
874+ TestBed . configureTestingModule ( {
875+ declarations : [ MyComp ] ,
876+ schemas : [ NO_ERRORS_SCHEMA ] ,
877+ errorOnUnknownElements : true ,
878+ } ) ;
876879
877880 const fixture = TestBed . createComponent ( MyComp ) ;
878881 fixture . detectChanges ( ) ;
@@ -914,8 +917,10 @@ describe('NgModule', () => {
914917 }
915918
916919 const spy = spyOn ( console , 'error' ) ;
917- TestBed . configureTestingModule (
918- { declarations : [ MyComp , CustomEl ] , errorOnUnknownElements : true } ) ;
920+ TestBed . configureTestingModule ( {
921+ declarations : [ MyComp , CustomEl ] ,
922+ errorOnUnknownElements : true ,
923+ } ) ;
919924
920925 const fixture = TestBed . createComponent ( MyComp ) ;
921926 fixture . detectChanges ( ) ;
@@ -982,17 +987,13 @@ describe('NgModule', () => {
982987 const TOKEN_A = new InjectionToken ( 'A' ) ;
983988 const TOKEN_B = new InjectionToken ( 'B' ) ;
984989 @NgModule ( {
985- providers : [
986- { provide : TOKEN_A , useValue : 'TokenValueA' } ,
987- ]
990+ providers : [ { provide : TOKEN_A , useValue : 'TokenValueA' } ] ,
988991 } )
989992 class AppModule {
990993 }
991994
992995 @NgModule ( {
993- providers : [
994- { provide : TOKEN_B , useValue : 'TokenValueB' } ,
995- ]
996+ providers : [ { provide : TOKEN_B , useValue : 'TokenValueB' } ] ,
996997 } )
997998 class ChildModule {
998999 }
@@ -1039,7 +1040,6 @@ describe('NgModule', () => {
10391040 @NgModule ( {
10401041 declarations : [ TestCmp ] ,
10411042 exports : [ TestCmp ] ,
1042- entryComponents : [ TestCmp ] // Only necessary for ViewEngine
10431043 } )
10441044 class MyModule {
10451045 constructor ( ngModuleRef : NgModuleRef < any > ) {
0 commit comments