shlomiassaf / ngx-modialog

Modal / Dialog for Angular
http://shlomiassaf.github.io/ngx-modialog
MIT License
686 stars 241 forks source link

Property 'then' does not exist on type 'DialogRef<TwoButtonPreset>'.ts(2339) #450

Open ayouuuuub opened 4 years ago

ayouuuuub commented 4 years ago

Hi i'm trying to run this code on Angular6 after updating from angular2-modal to ngx-modialog

this.modal.confirm()
      .showClose(true)
      .title(this.translator.instant('common.message.confirm.delete'))
      .keyboard(27)
      .okBtn(this.translator.instant('common.text.yes'))
      .cancelBtn(this.translator.instant('common.text.no'))
      .message("<h5>" + this.translator.instant('common.message.confirm.deleteAll') + "</h5>")
      .open()
      .then(( d:any ) => d.result 

but after compiling i get this error :

Property 'then' does not exist on type 'DialogRef<TwoButtonPreset>'.ts(2339)
nguyenbathanh commented 3 years ago
this.modal.confirm()
      .showClose(true)
      .title(this.translator.instant('common.message.confirm.delete'))
      .keyboard(27)
      .okBtn(this.translator.instant('common.text.yes'))
      .cancelBtn(this.translator.instant('common.text.no'))
      .message("<h5>" + this.translator.instant('common.message.confirm.deleteAll') + "</h5>")
      .open()
      .result
      .then(( d:any ) => d.result