I am trying to get data from my JSON file using AngularJs 1.6
myApp.controller("homeCtrl", function($scope, $http) {
$scope.Data = [];
var getJsonData = function() {
$http.get('contactlist.json').then(function(response) {
$scope.Data = response.data;
console.log(response.data);
});
}
getJsonData();
});
But it's not going to response I am putting debug on then line but my page opened without stopping on debug response. So it's not going on then(function(reponse){
My JSON File:
var contactList = [
{
"firstName": "Joe",
"lastName": "Perry",
"contactNumber": "444-888-1223",
"contactEmail": "[email protected]"
},
{
"firstName": "Kate",
"lastName": "Will",
"contactNumber": "244-838-1213",
"contactEmail": "[email protected]"
}
];