0
私のhtml:オブジェクトから来るhtmlの値を一貫して表示するには?
<p ng-repeat="gg in john(z.items)">Item:{{gg.name}} Quantity:{{gg.quantity}}</p>
マイコントローラ:
オブジェクト::{name: "Beef Burger", quantity: 1, rate: 150}
オブジェクト:{name: "Maharaja Mac", quantity: 1, rate: 150}
$http.get('/api/restros/myorders').success(function(val){
console.log("my orders:");
console.log(val);
var temp=[];
$scope.mydata=val;
$http.get('/api/restros/').success(function(data){
$scope.john=function(parent){
console.log("parent");
console.log(parent);
for(var i=0;i<parent.length;i++){
temp=[];
for(var j=0;j<data.length;j++){
if(data[j]._id==parent[i].id){
temp.push([{name:data[j].name,quantity:parent[i].quantity,rate:data[j].rate}]);
}
}
console.log(typeof (temp[0]));
}
}
});
});
は、今私はそうのようなコンソールでの応答を表示したいです
なぜangleのng-repeatを使用しないのですか? –
z.itemsとは? – defaultcheckbox
Z.itemsは私が解析したいアイテムであり、私の会社から提供されたAPIから来ています。 –