shlomiassaf / ngx-modialog

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

respond to callback from confirm #352

Open d4e666 opened 7 years ago

d4e666 commented 7 years ago

IMPORTANT: Please provide a sample using:

I provided the functions in the following ways, but neither work

this.modal.confirm() .size('sm') .isBlocking(true) .showClose(true) .keyboard(27) .title('Are you sure?') .body('Are you sure you want to delete "User" from that file?') .open().then(function () { this.showSuccess }, function () { this.showWarning });

METHOD 2: this.modal.confirm() .size('sm') .isBlocking(true) .showClose(true) .keyboard(27) .title('Are you sure?') .body('Are you sure you want to delete "User" from that file?') .open().then(this.showSuccess, this.showWarning);

devinvail commented 7 years ago

+1

qwe852147 commented 7 years ago

I use following code it can call the function when I click Ok or Cancel button

.open()
            .then((dialog: DialogRef<TwoButtonPreset>) => {
                dialog.result.then(result => {
                   function here
                }).catch(() => {
                   function here
                })
            }
            );
igoreliasm commented 7 years ago

@qwe852147 is right, this information has should be explicit on documentation. :/

nch3ng commented 6 years ago

You guys are correct. Thank you guys are good ones to help the documents!