-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Feature Description
Provide a brief summary of the feature you would like to see.
I find the setup process of components to be quite redundant in some cases. An example is creating a dialog. I see that angular material has schematics. It would be nice if there was something for a dialog:
ng generate @angular/material:dialog <component-name>
This would generate a component like so:
import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
@Component({
selector: 'app-aggregate-dialog',
templateUrl: './aggregate-dialog.component.html',
styleUrls: ['./aggregate-dialog.component.scss']
})
export class AggregateDialogComponent implements OnInit {
private _dialogRef: MatDialogRef<AggregateDialogComponent>;
constructor(dialogRef: MatDialogRef<AggregateDialogComponent>, @Inject(MAT_DIALOG_DATA) data: any) {
this._dialogRef = dialogRef;
}
ngOnInit() {
}
}
This would also mean the dialog component would be added to the entryComponents
in the module.
Use Case
Describe the use case(s) that the proposed feature would enable.
For dialog-heavy applications, setting up dialogs require quite a few steps. It would be nice if this was a little more streamlined. Given that (I believe) if you want to use an Angular Material dialog, it requires it's own component I think it would be useful for the proper (or common) references to be added when generated. It sounds like the entryComponents
step won't be needed in v9
, so that is nice.