I am unable to access 'this' in callback function but i end up using 'this' pointing to AJAX object rather than 'this' object who invoked onClickEmail function. I tried getting the reference in 'that' variable but that didn't helped much either. Anything I am doing wrong here:
onClickEmail(){
var that = this;
$.ajax({
url: 'http://ift.tt/2i4O5zw'
}).then(function(response) {
hey = that;
});
}
Aucun commentaire:
Enregistrer un commentaire