my Controller says:
app.controller("PatientsController",function ($scope, $sce, $http,$window,$timeout){
var myScope = $scope;
myScope.PatientList = [];
myScope.getPatients = function () {
$http.get('http://my-ip/dashboard/patientlist').then(function(data){
myScope.PatientList = data.data;
console.log(myScope.PatientList );
});
};
myScope.getPatients();
});
console.log has:
[{
"appointmentcount": "7",
"name": "A",
"phonenumber": "B",
"dateregistered": "2017-01-04 15:20:08"
}, {
"appointmentcount": "27",
"name": "C",
"phonenumber": "D",
"dateregistered": "2017-01-04 15:43:51"
}]
trying to retrieve it using ng-repeat is not giving any output:
<table class="table table-bordered table-condensed table-striped">
<div ng-repeat="pp in PatientList">
<tr>
<td>{{pp.name}} </td>
</tr>
</div> <!-- div ends -->
</table>
any idea what am I missing?
using http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js
ng-appandng-controllercorrectly setup in HTML?