次のような ajaxCall で配列を返します: http://d.pr/i/ojR4
オブジェクトの内部は Json です (例: http://d.pr/i/aAM2 ) これを .hbs ファイル (バックボーン) にプッシュすると、配列であり、プレーンのみを受け入れるため、ループすることはできません。 JSON。
これを完全に JSON に変換する方法はありますか?
以下の私のビューでの私のrenderfunction:
render: function(){
var self = this;
var tripData;
console.log("[TripListView] render");
$.ajax({
url: Util.api + "/getalltrips",
type:"GET",
success: function(data){
console.log(data); // This is the output given
tripData = data;
}, error:function(){
console.log(arguments);
}
});
$('#container').html(this.template({trips: data}));
return this;
}