@@ -36,7 +36,7 @@ import {Schema} from './schema';
3636import { TsComponentGenerator } from './generators/ts-component.generator' ;
3737import { addModuleImportToModule } from '@angular/cdk/schematics' ;
3838import ora from 'ora' ;
39- import { WIZARD_CONFIG_FILE } from " ../table-prompter/index" ;
39+ import { WIZARD_CONFIG_FILE } from ' ../table-prompter/index' ;
4040
4141export default function ( options : Schema ) : Rule {
4242 return ( tree : Tree , context : SchematicContext ) : void => {
@@ -141,9 +141,7 @@ export function generateTable(options: Schema): Rule {
141141 ]
142142 ) ,
143143 updateConfigFiles ( options ) ,
144- addToAppModule ( options . skipImport , [
145- { name : 'BrowserAnimationsModule' , fromLib : '@angular/platform-browser/animations' }
146- ] ) ,
144+ addToAppModule ( options . skipImport , [ { name : 'BrowserAnimationsModule' , fromLib : '@angular/platform-browser/animations' } ] ) ,
147145 addToComponentModule ( options . skipImport , options , [
148146 { name : 'MatTableModule' , fromLib : '@angular/material/table' } ,
149147 { name : 'MatPaginatorModule' , fromLib : '@angular/material/paginator' } ,
@@ -169,7 +167,7 @@ export function generateTable(options: Schema): Rule {
169167 addToComponentModule (
170168 {
171169 skip ( ) {
172- return ! options . addCommandBar || options . skipImport as boolean ;
170+ return ! options . addCommandBar || ( options . skipImport as boolean ) ;
173171 } ,
174172 } ,
175173 options ,
@@ -188,7 +186,7 @@ export function generateTable(options: Schema): Rule {
188186 addToComponentModule (
189187 {
190188 skip ( ) {
191- return options . templateHelper . getDateProperties ( options ) . length < 1 || options . skipImport as boolean ;
189+ return options . templateHelper . getDateProperties ( options ) . length < 1 || ( options . skipImport as boolean ) ;
192190 } ,
193191 } ,
194192 options ,
@@ -197,7 +195,7 @@ export function generateTable(options: Schema): Rule {
197195 addToComponentModule (
198196 {
199197 skip ( ) {
200- return ! options . enabledCommandBarFunctions ?. includes ( 'addDateQuickFilters' ) || options . skipImport as boolean ;
198+ return ! options . enabledCommandBarFunctions ?. includes ( 'addDateQuickFilters' ) || ( options . skipImport as boolean ) ;
201199 } ,
202200 } ,
203201 options ,
@@ -209,7 +207,7 @@ export function generateTable(options: Schema): Rule {
209207 addToComponentModule (
210208 {
211209 skip ( ) {
212- return ! options . enabledCommandBarFunctions ?. includes ( 'addEnumQuickFilters' ) || options . skipImport as boolean ;
210+ return ! options . enabledCommandBarFunctions ?. includes ( 'addEnumQuickFilters' ) || ( options . skipImport as boolean ) ;
213211 } ,
214212 } ,
215213 options ,
@@ -218,17 +216,14 @@ export function generateTable(options: Schema): Rule {
218216 { name : 'MatOptionModule' , fromLib : '@angular/material/core' } ,
219217 ]
220218 ) ,
221- addToAppSharedModule (
222- false ,
223- [
224- { name : 'MatButtonModule' , fromLib : '@angular/material/button' } ,
225- { name : 'MatDialogModule' , fromLib : '@angular/material/dialog' } ,
226- { name : 'MatCheckboxModule' , fromLib : '@angular/material/checkbox' } ,
227- { name : 'MatIconModule' , fromLib : '@angular/material/icon' } ,
228- { name : 'FormsModule' , fromLib : '@angular/forms' } ,
229- { name : 'NgIf' , fromLib : '@angular/common' } ,
230- ]
231- ) ,
219+ addToAppSharedModule ( false , [
220+ { name : 'MatButtonModule' , fromLib : '@angular/material/button' } ,
221+ { name : 'MatDialogModule' , fromLib : '@angular/material/dialog' } ,
222+ { name : 'MatCheckboxModule' , fromLib : '@angular/material/checkbox' } ,
223+ { name : 'MatIconModule' , fromLib : '@angular/material/icon' } ,
224+ { name : 'FormsModule' , fromLib : '@angular/forms' } ,
225+ { name : 'NgIf' , fromLib : '@angular/common' } ,
226+ ] ) ,
232227 generateComponentFiles ( options ) ,
233228 generateStyles ( options ) ,
234229 generateTranslationFiles ( options ) ,
@@ -611,9 +606,6 @@ function updateConfigFiles(options: any): Rule {
611606 if ( ! angularBuildOptions [ 'styles' ] . includes ( defaultMaterialtheme ) ) {
612607 angularBuildOptions [ 'styles' ] . push ( defaultMaterialtheme ) ;
613608 }
614- } else if ( ! options . getOptionalMaterialTheme && angularBuildOptions [ 'styles' ] . includes ( defaultMaterialtheme ) ) {
615- const index = angularBuildOptions [ 'styles' ] . indexOf ( defaultMaterialtheme ) ;
616- angularBuildOptions [ 'styles' ] . splice ( index , 1 ) ;
617609 }
618610
619611 tree . overwrite ( '/angular.json' , JSON . stringify ( angularJson , null , 2 ) ) ;
0 commit comments