I'm new in angularjs,i'm trying to load data from my json file on view. json file have some list of patients. But does not get showed on my view
here is my 'patient.json' file
[
{
"id": 0,
"first_name": "John",
"last_name": "Abruzzi",
"middle_name": "Kewan",
"DOB": "12/03/1935",
"ssn": "254-2342-42",
"sex" : "Male",
"country" : "USA",
"city" : "Greater New York",
"phone" : "1234124822",
"military_branch" : "Army",
"zip" : "08675",
"guid" : ""
},
{
"id": 1,
"first_name": "Peter",
"last_name": "Burk",
"middle_name": "S",
"DOB": "31/06/1945",
"ssn": "342-9876-54",
"sex" : "Male",
"country" : "USA",
"city" : "New York",
"phone" : "3346573924",
"military_branch" : "FBI",
"zip" : "25643",
"guid" : ""
},
{
"id": 2,
"first_name": "Neal",
"last_name": "caffery",
"middle_name": "Sam",
"DOB": "28/02/1988",
"ssn": "420-4204-20",
"sex" : "Male",
"country" : "USA",
"city" : "New York",
"phone" : "676554323",
"military_branch" : "Air Force",
"zip" : "26531",
"guid" : ""
},
]
here is my controller.js
var patientApp = angular.module('patientApp', []);
patientApp.controller('PatientListCtrl',['$scope','$http', function ($scope, $http) {
$http.jsonp('/json/patients.json').success(function (data) {
$scope.patients = data;
})
});
$scope.orderProp = 'id';
}]);
Here is my 'index.html' file
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" data-ng-app="patientApp">
<head>
<title>Patient Management</title>
<script src="js/angular.js"></script>
<script src="js/angular-resource.min.js"></script>
<script src="js/controller.js"></script>
</head>
<body data-ng-controller="PatientListCtrl">
<table>
<thead>
<tr>ID</tr>
<tr>First Name</tr>
<tr>Last Name</tr>
<tr>SSN</tr>
<tr>DOB</tr>
</thead>
</table>
<div data-ng-repeat="patient in patients">
<table>
<tr>{{patient.id}}</tr>
<tr>{{patient.last_name}}</tr>
<tr>{{patient.first_name}}</tr>
<tr>{{patient.SSN}}</tr>
<tr>{{patient.DOB}}</tr>
</table>
</div>
</body>
</html>
I think i'm missing something. plz help me ,thanks in advance.