LukasMarx / angular-dynamic-components

99 stars 61 forks source link

Nested dialog calls #3

Closed henrydeguzman closed 4 years ago

henrydeguzman commented 4 years ago

Hello I am having issue on nested dialog specially when closing the parent dialog wont close after child closed. Also, having issue on changing the width of the child dialog which parent will automatically changes It's width because the data is inherited on it's parent. Please help, thanks!

henrydeguzman commented 4 years ago

I have to create default values on the config so I set default config on the constructor modal.service.ts

constructor( private componentFactoryResolver: ComponentFactoryResolver, private appRef: ApplicationRef, private injector: Injector ) { this._defaultConfig = { title: 'Dialog' }; }

On appendDialogComponentToBody

private appendDialogComponentToBody(config: GlobalModalConfig): any { config = _.cloneDeep(_.merge(this._defaultConfig, config)); .... }

I just clone the config values pass to another appended dialog which will not affect the parent config values. By the way I am using loadash.

This works on me so far. Thanks for the tutorial bro!