I have a project I am working on where I have a json array (that will later come from a web service)
and I am trying to use ng-repeat to load that data into a table. (I have done this before, this time it's just slipping paste me what I am missing)
I posted the code to github here: https://github.com/sheets/Sch
I'd love any help I am posting the code here as well:
<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>
and 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
});
});
<td>.