私はMithrill v1.0.0デベロッパーを使用していますと呼ばれるこのm.requestは、ここでは、コンソール上のコードはなぜ二度
var scrollable = {};
scrollable.Product = {
list : [],
loadList : function(store){
m.request({
method : "GET",
url : "APIUrl" + store,
withCredentials : true
}).then(function(result){
scrollable.Product.list = result;
})
}
}
scrollable.oninit = function(){
scrollable.Product.loadList("authentic")
}
scrollable.view = function(){
console.log(scrollable.Product.list.result) //Here's give me two line log
}
だその私に2行のログを与え、最初のものは未定義であり、第二れます1つはAPIの結果値を持つ配列です。
loadListは非同期です - 私はあなたに残りの部分を記入させていただきます –