We would like to use schematics to generate a feature module that contains components we are generating over and over.
I've started following this tutorial: https://medium.com/@michael.warneke/merging-custom-angular-schematics-c14a303f63b6
But when I created the __name@dasherize@singularize__.module.ts
file and try to build the project I get TS compilation errors.
This is how my file looks like:
import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
@NgModule({
imports: [
CommonModule,
],
declarations: [],
providers: [],
entryComponents: []
})
export class <%= classify(name) %>Module {
static forRoot(): ModuleWithProviders {
return {
ngModule: <%= classify(name) %>Module,
providers: []
};
}
}
And this is the error:
error TS6133: 'ModuleWithProviders' is declared but its value is never read.