I am trying to follow the docs on https://material.angular.io/components/component/dialog but I cannot understand why it has the below issue?
I added the below on my
While integrating material dialog is possible, I found that the complexity for such a trivial feature is pretty high. The code gets more complex if you are trying to achieve a non-trivial features.
For that reason, I ended up using PrimeNG Dialog, which I found pretty straightforward to use:
m-dialog.component.html:
Content
m-dialog.component.ts:
@Component({
selector: 'm-dialog',
templateUrl: 'm-dialog.component.html',
styleUrls: ['./m-dialog.component.css']
})
export class MDialogComponent {
// dialog logic here
}
m-dialog.module.ts:
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { DialogModule } from "primeng/primeng";
import { FormsModule } from "@angular/forms";
@NgModule({
imports: [
CommonModule,
FormsModule,
DialogModule
],
exports: [
MDialogComponent,
],
declarations: [
MDialogComponent
]
})
export class MDialogModule {}
Simply add your dialog into your component's html:
PrimeNG PrimeFaces documentation is easy to follow and very precise.