是否可以从customDialog中检索数据?

时间:2017-01-06 10:18:48

标签: angular angular2-mdl

是否可以打开自定义对话框组件,然后将数据发送回打开自定义对话框的组件?

this._dialogService.showCustomDialog({
  component: CustomSelectComponent,
  providers: [{provide: 'ROOM_ID', useValue: 1}],
  isModal: true,
  styles: {'width': '580px'},
  clickOutsideToClose: true
}).subscribe((dialogReference: MdlDialogReference) => {
    dialogReference.onHide().subscribe((data) => {

      // DATA SHOULD CONTAIN THE DATA PASSED IN TO THE hide METHOD
      console.log(data); 

    });
});

0 个答案:

没有答案