我使用此代码加载json arr -
example.controller('ExhibitionTabCtrl', ['$scope', '$http', function($scope,$http) {
$http.get("json/pills.json")
.success(function (response)
{
console.log(response);
$scope.users = response;
});
}]);
在列表视图中,红色我的json数据就像这样
<ion-view title="Sig">
<ion-content class="padding" ng-controller="ExhibitionTabCtrl">
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title">Ionic Blank Starter</h1>
</ion-header-bar>
<ion-content>
<ion-list>
<ion-item ng-repeat="x in users|orderBy:'name'">
{{ x.name + ', ' + x.full_name+', '+x.description}}
</ion-item>
</ion-list>
</ion-content>
</ion-pane>
</ion-content>
</ion-view>
但数据没有显示在列表视图中。我可以解决这个问题。任何人都可以帮助我。谢谢。
答案 0 :(得分:2)
kosala,您需要指定$scope.users = response.Sheet1
而不是$scope.users = response
。