jeudi 10 novembre 2016

Can't access self variable inside query function

function doSomething(){  
var self=this;   
var a,b,c;   
//do something  
reqArray="somevalue";   
this.store.query("record",{"filter":"[{'api_name':'somevalue','comparator':'somevalue','value':"+reqArray+"}]"}).then(function(data){                     
//can't access this,a,b,c or self             
});  
}

I get the data i need inside the then function after the promise is resolved but i am not able to access anything outside the then function




Aucun commentaire:

Enregistrer un commentaire