我有一个项目,我就在那里我有一个JSON阵列的工作(这在以后从Web服务)Angular.js使用JSON
,我试图用NG-重复NG-重复没有数据将该数据加载到表中。 (我以前做过这个,这个时候它只是滑倒贴上我,我错过了什么)
我贴的代码GitHub的位置:https://github.com/sheets/Sch
我很乐意帮忙,我在这里张贴的代码以及:
<body ng-app="MyApp">
<div ng-controller="SchCtrl">
<table class="table table-striped table-bordered">
<thead>
<th width="15%">Date and Time</th>
<th width="50%">Provider</th>
<th width="15%">Location</th>
<th width="10%">Map</th>
</thead>
<tbody>
<tr ng-repeat="appointment in appointments | orderBy:'startDatetime':true">
{{appointments.startDatetime | date:'MM/dd/yyyy HH:mm'}}
{{appointments.providerName}}
{{appointments.apptLocation}}</tr></tbody></table>
</div>
</body>
和app.js:
var app = angular.module("MyApp", []);
app.controller("SchCtrl", function($scope, $http) {
$http.get('/appointments.json').
success(function(data, status, headers, config) {
$scope.appointments = data;
}).
error(function(data, status, headers, config) {
// log error
});
});
一件事......你有没有''。 – MikeSmithDev 2014-09-03 16:41:06
删除以进行调试。 – 2014-09-03 16:43:50