I am having trouble to read data from my test.json file with the #http service. I am running all in a xampp localhost, can't really figure what is happening, here is the js code. Thanks in advance for the help.
<script type="text/javascript">
var app = angular.module('myApp', []);
app.controller('myCtrl', ['$http', '$scope', function($http, $scope){
$http.get('test.json').success(function(response){
$scope.myData = response;
});
}]);
</script>
EDIT: That is the json file:
[{"id":"1","name":"John"},
{"id":"2","name":"Paul"},]
And this is the rest of the html:
<ul>
<li ng-repeat="data in myData">
{{data.id}}
{{data.name}}
</li>
</ul>