Angularjs 将多维对象中的数据填充到ng重复列表中
我从ionic应用程序中的数据库中获取以下数据。我正在将其保存到$scope.dbCustomersArray:Angularjs 将多维对象中的数据填充到ng重复列表中,angularjs,ionic-framework,Angularjs,Ionic Framework,我从ionic应用程序中的数据库中获取以下数据。我正在将其保存到$scope.dbCustomersArray: [ { "customer_id":1, "customer_name":"Test Company", "customer_address":"17 Morena Blvd Camarillo", "customer_city":"Ventura", "customer_contactnumber":"80
[
{
"customer_id":1,
"customer_name":"Test Company",
"customer_address":"17 Morena Blvd Camarillo",
"customer_city":"Ventura",
"customer_contactnumber":"805-832-6163",
"Company_id":1
},
{
"customer_id":2,
"customer_name":"Another test company",
"customer_address":"2742 Distribution Way Metairie",
"customer_city":"Jefferson",
"customer_contactnumber":"504-979-9175",
"Company_id":1
},
{
"customer_id":3,
"customer_name":"Final test company",
"customer_address":"775 W 17th St San Antonio",
"customer_city":"Bexar",
"customer_contactnumber":"210-812-9597",
"Company_id":1
}
]
我试图在html中循环使用它
<label class="item item-input" style="padding: 0px">
<div class="row">
<label class="item item-input item-select col">
<div class="input-label" style="visibility: hidden">
Customer
</div>
<select>
<option> -- Customer -- </option>
<ion-item ng-repeat="customer in $scope.dbCustomersArray">
<option> Hello, {{customer.customer_name}}! </option>
</ion-item>
</select>
</label>
</div>
</label>
请帮我解决这个问题。我看不出我错在哪里。先谢谢你
编辑
当我点击客户选择列表时,我无法在我的ionic应用程序中看到数组中的值。看起来您有两个问题:
关于,从中删除$scope:。这不是一个正确的答案syntax@MichaelZucchetta我这样做了,并试图再次运行该应用程序。在我的应用程序中,数组中没有可见的值。请等待答复。我自己也看了一眼,但结果不起作用。使用
时,值显示良好,但上面的代码不会显示任何值。
for (var customer in $scope.dbCustomersArray) {
console.log("LOGGING A CUSTOMER - " + customer.customer_name);
}