I'm having trouble retrieving 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();
});
The issue I'm encountering is that the code doesn't seem to be reaching the response part and my page loads without stopping at the debug response. It seems stuck on `then(function(reponse){`
This is how my JSON File looks like:
var contactList = [
{
"firstName": "Joe",
"lastName": "Perry",
"contactNumber": "444-888-1223",
"contactEmail": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ce6e3e9ccefe3fee8e5ffa2f9ff">[email protected]</a>"
},
{
"firstName": "Kate",
"lastName": "Will",
"contactNumber": "244-838-1213",
"contactEmail": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="325953465772515d40565b411c4741">[email protected]</a>"
}
];