ankosoftware / ng2-bootstrap-modal

Library to simplify the work with bootstrap modal dialogs
MIT License
54 stars 62 forks source link

removeAll not working. #37

Open MyEidos opened 7 years ago

MyEidos commented 7 years ago

I need to close all opened popups. this.dialogService.removeAll() not works and fire an error: Uncaught (in promise): TypeError: Cannot read property 'clear' of undefined

Angular 4.3

engyash commented 7 years ago

I am getting the same issue.

ednjv commented 5 years ago

23 should fix it, but hasn't been merged

My workaround was to check for the dialogHolderComponent on the DialogService instance

if (this.dialogService['dialogHolderComponent']) { // to avoid compiler errors
  this.dialogService.removeAll();
}