Hello
I’m in main var app = new Framework7({...});
i’ve created a function under root methods… what is the correct way to call setState? this. and app. produce an error
Thanks for reply
probably i’m stupid… I don’t know
if I call self.$setState() into page component works fine
but If I call into a root method, setState give me error
loginUser: function(e, p){
app.request.post(app.data.apiurl,
{ resource: 'Login', email: e, password: p },
function (data, status, xhr) {
console.log(data.content.response);
var resp = data.content.response;
if(resp.status == "success"){
var user_info = resp.data.customer_info;
/*Here I would call setState to update root data */
}else{
app.preloader.hide();
app.dialog.alert('Login non riuscito');
}
}, function (status, xhr) {
console.log(xhr);
}, 'json');
},