Open
Description
Feature Description
Currently, Angular Material's MatDialog and CDK's Dialog components use MAT_DIALOG_DATA
for passing data. This feature proposes to allow the usage of @input for data sharing instead.
Use Case
This feature allows for greater flexibility and reusability of dialog components, particularly when using the Router option withComponentInputBinding
. For example:
// Proposed usage with @Input
@Component({
selector: 'app-my-dialog',
template: ``
})
export class MyDialogComponent {
@Input() name: string;
@Input() age: number;
}
// Open dialog
this.dialog.open(MyDialogComponent, {
data: { name: 'John', age: 30 }
});