-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
Description
What problem does this feature solve?
I always find myself centering modals with nzCentered: true
, and I wish it would be the default. Since making it the default now would break existing apps, I'm wondering if the nzCentered
parameter could be passed in the default NZ_CONFIG provider in AppModule?
Thanks
What does the proposed API look like?
// app.module.ts
const ngZorroConfig: NzConfig = {
modal: {
nzCentered: true
}
};
// ...
@NgModule({
declarations: [AppComponent],
providers: [
{ provide: NZ_CONFIG, useValue: ngZorroConfig },
],
bootstrap: [AppComponent],
})
export class AppModule {}
// Opening a modal before this change
this.modalService.confirm({
nzCentered: true,
nzTitle: 'Title',
nzContent: 'Content',
});
// Opening a modal after this change
this.modalService.confirm({
nzTitle: 'Title',
nzContent: 'Content',
});