akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.06k stars 1.51k forks source link

After the parent component is opened, the child component cannot be closed using Nbwindowref #3144

Open janice1015 opened 2 years ago

janice1015 commented 2 years ago

I have two components, one is parent and the other is child component . I'm using Nebular ui to create a window (using nbWindowService.open(ChildComponent). There's a form in the child component and I need to get that data back into the parent component for processing.

When I close the window opened by the parent component on the child component, using this.windowref.close() does not work!!

angular.cli :12.1 nebular:8.0.0 ngx-admin:8.0.0

my code:

parent component: constructor( public windowRef: NbWindowRef, private windowService: NbWindowService }

 this.windowRef = this.windowService.open(content, { buttons: buttonsconfig });

child component:

@Input() windowref: NbWindowRef; @Output() afterupdate = new EventEmitter(); constructor( public windowRef: NbWindowRef, private windowService: NbWindowService) { } close() { this.windowRef.close();}

async update() { this.afterupdate.emit(); this.close(); }