I am unable to call a function inside promise of ng2-sweetalert2 plugin
swal({ title: \'Are you sure?\', text: \"You won\'t be able to revert this!\"
Assuming you're using TypeScript, you could use the arrow function expression, which preserves the value of this.
this
swal({...}).then((x) => console.log(this)); // now 'this' is your component