ngx-modialog
ngx-modialog copied to clipboard
respond to callback from confirm
IMPORTANT: Please provide a sample using:
- **I'm submitting a question **
- What is the current behavior? I copied code from your code editor into VS2015 Code, and is all works fine. I notice that the "open" method returns what looks like a Promise, but when I provide the promisse with function references, I get the error "Cannot read property 'fn' of undefined".
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);
-
What is the expected behavior? to be able to handle callback from the confirm or any other modal dialog (e.g. can I delete something or request additional input before proceeding). I guess I'm just missing an example here?
-
Please tell us about your environment:
- Angular version: 4.1.2
- Browser: [all]
+1
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
})
}
);
@qwe852147 is right, this information has should be explicit on documentation. :/
You guys are correct. Thank you guys are good ones to help the documents!