1
Running this code the sequence of Alerts I have is begin, outside, final e inside
, how to solve this ??
addLine(){
alert('begin')
jQuery.get('database/addClube/'+this.clube);
jQuery.get('database/getClubes', function(data){
this.list = data;
console.log(this.list);
alert('inside')
});
console.log(this.list);
alert('outside')
for(item in this.list){
//alert(item);
}
this.clube = '';
alert('final')
},
Learn to create Promises, that’s your problem.
– Gabriel Rodrigues