So I am using a uikit confirmation modal in my app. My problem is, when I am going to click the <button>
for confirmation. the this
inside function is undefined
. here's my code...
declare var UIkit:any;
deleteData(dataArr): void {
UIkit.modal.confirm('Are you sure you want to delete this?', function() {
console.log(dataArr);
console.log(this);
//use service here...
UIkit.modal.alert('Confirmed!');
});
}
Inside that function I wish to use service for http request but I am having a problem on the this
. I am using Angular 2.x.