我尝试从 WindowComponent(子)向父组件发送响应,onClose observable 应该返回一个 observable,但我将它设置为返回它并且它不起作用
// parent component
this.windowService
.open(WindowFormEditDocumentComponent, {
title: `Edit Document`,
context: {
formId: this.selection.selected[0]["formId"],
id: this.selection.selected[0]["_id"],
recipient: this.selection.selected[0]["recipient"],
},
windowClass: "background",
})
.onClose.subscribe((data) => {
console.log("aquiv", data); // undefined
});
// child component
closed$ = new Subject();
get onClose() {
return this.closed$.asObservable();
}
this.closed$.next("test");
https://akveo.github.io/nebular/docs/components/dialog/api#nbdialogservice