I have this main module in Angular 4:
@NgModule({
imports: [
//.. other modules
ReactiveFormsModule,
],
declarations: [
AppComponent,
...routingComponents,
],
providers: [
...routingGuards,
],
exports: [
ReactiveFormsModule,
],
bootstrap: [AppComponent]
})
export class AppModule { }
I also have another module, AdminModule, that is lazy loaded from this main AppModule. On the AdminModule I have some routes where I also use the reactive form. However, when I try to create a new form I keep getting errors like these:
Error: Template parse errors: Can't bind to 'formGroup' since it isn't a known property of 'form'.
Trying to fix this problem, I saw that I had to export the ReactiveFormsModule from the main module in order to use with other modules, but I'm doing so and still getting the error. What am I doing wrong in here?