Hey there,
I'm trying to utilize the Angular Material dialog, but I'm encountering issues with the imports and I can't seem to figure out what's wrong.
I have an Angular Material module where I imported MatDialog, and I made sure to import it in app.module as well.
The error message I'm getting is: ERROR Error: Uncaught (in promise): Error: Type DialogFormComponent is part of the declarations of 2 modules: AppModule and ProduitsModule!
app.module
import { DialogFormComponent } from './produits/dialog-form/dialog-form.component';
@NgModule({
declarations: [
AppComponent,
DialogFormComponent
],
entryComponents: [DialogFormComponent],
Produits.ts
export class ProduitsComponent implements OnInit {
public productArray: Produit[] = [];
constructor(public dialog: MatDialog) { }
ngOnInit() {
}
openDialog() {
this.dialog.open(DialogFormComponent);
}
}