In the below code,
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dashboard</title>
<!-- Libs -->
<script src="angular.js"></script>
<script>
var countryApp = angular.module('countryApp', []);
countryApp.controller('CountryCtrl', function ($scope, $http){
$http.get('country_codes.json').success(function(data) {
$scope.countries = data;
});
});
</script>
</head>
<body ng-controller="CountryCtrl">
</body>
</html>
/* country_codes.json */
[
{
"code": "AD",
"name": "Andorra",
"population": "84000"
},
{
"code": "AE",
"name": "United Arab Emirates",
"population": "4975593"
}
]
As per debugging, I do not see any error and the callback functions does not execute.
Why the controller callback does not execute?
.errorcallback too, not just the.success.