Loading...
Loading...
Implement Syncfusion Angular Dialog component with complete API coverage. Build modal/modeless dialogs, confirmation popups, forms in dialogs, draggable windows, and overlaid content. Use this skill when users need dialog implementation, positioning, animations, WCAG 2.2 accessibility, forms integration, and event handling.
npx skill4agent add syncfusion/angular-ui-components-skills syncfusion-angular-dialogimport { Component, ViewChild } from '@angular/core';
import { DialogModule, DialogComponent } from '@syncfusion/ej2-angular-popups';
@Component({
selector: 'app-root',
imports: [DialogModule],
template: `
<div id="dialog-container" style="height: 500px;">
<button class="e-control e-btn" (click)="onOpenDialog()">
Open Dialog
</button>
<ejs-dialog
#ejDialog
target="#dialog-container"
[showCloseIcon]="true"
width="400px"
content="This is a Dialog content"
>
<ng-template #header>
<div class="e-dlg-header-content">
<span>Dialog Title</span>
</div>
</ng-template>
</ejs-dialog>
</div>
`
})
export class AppComponent {
@ViewChild('ejDialog') ejDialog!: DialogComponent;
onOpenDialog(): void {
this.ejDialog.show();
}
}#dialog-container {
height: 500px;
}// Create a modal dialog for confirmation
<ejs-dialog
[isModal]="true"
[showCloseIcon]="true"
width="350px"
content="Are you sure you want to delete this item?"
>
<ng-template #footer>
<button class="e-control e-btn e-primary" (click)="onConfirm()">
Yes, Delete
</button>
<button class="e-control e-btn" (click)="onCancel()">
Cancel
</button>
</ng-template>
</ejs-dialog>// Dialog containing a reactive form
<ejs-dialog [showCloseIcon]="true" width="450px">
<form [formGroup]="form">
<div class="e-dlg-content">
<input formControlName="name" placeholder="Enter name" />
<input formControlName="email" placeholder="Enter email" />
</div>
</form>
<ng-template #footer>
<button class="e-control e-btn e-primary" (click)="onSubmit()">
Submit
</button>
</ng-template>
</ejs-dialog>// Dialog positioned at a specific location
<ejs-dialog
[position]="{ X: 100, Y: 50 }"
width="400px"
content="Positioned Dialog"
>
</ejs-dialog>| Property | Type | Purpose | Example |
|---|---|---|---|
| boolean | Block parent interaction | |
| boolean | Show close button in header | |
| string | number | Set dialog width | |
| string | number | Set dialog height | |
| string | number | Minimum height constraint | |
| PositionDataModel | Set position (X, Y) or preset | |
| HTMLElement | string | Set container element | |
| string | HTMLElement | Set content text or HTML | |
| string | HTMLElement | Set header text or element | |
| ButtonPropsModel[] | Add footer buttons | |
| boolean | Close on Escape key | |
| boolean | Enable header dragging | |
| boolean | Enable resizing | |
| ResizeDirections[] | Specify resize directions | |
| string | Custom CSS class(es) | |
| AnimationSettingsModel | Configure animations | |
| boolean | Save state between reloads | |
| number | Z-order for layering | |