Use an arrow function...
declare var UIkit:any;
deleteData(dataArr): void {
UIkit.modal.confirm('Are you sure you want to delete this?', () => {
console.log(this);
// [...]
});
}
Check out MDN: Arrow functions for details on the matter.
An arrow function does not create its own this context, so this
has
its original meaning from the enclosing context.