Closed DDriggs00 closed 4 years ago
Hi @DDriggs00
Firstly thanks for using Notiflix.
I did not get your expectation at all but maybe you can try the code below and feedback.
Thanks.
Furkan.
// ....
var aMysteriousThis = this;
Confirm.Show(
'Notiflix Confirm',
'Do you agree with me?',
'Yes',
'No',
function(){
// Yes button callback
aMysteriousThis.classvariable = true;
alert('alert is a typescript function');
},
function(){
// No button callback
alert('alert is a non-typescript function');
}
);
Thank you, This is a good workaround. I can confirm that it works with typescript 3.8/Angular 9
It would still be nice to not have to do a workaround like this, but I understand this is a pure JS library.
Describe the bug When adding a typescript variable to a callback function, the button which calls the does nothing when clicked.
To Reproduce Steps to reproduce the behavior:
import { Confirm } from 'notiflix';
Confirm
as follows and call from a class function:Expected behavior The yes button sets
this.classvariable
to true then raises the alert.Desktop
Not tested on Mobile