So i'm testing $http.get in angular to grab a json file and i've used this code:
$scope.classes = $http.get('coursedata.json')
.success(function (result){
$scope.classes = result; a
console.log(result);
})
.error(function(data,status){
console.log(status);
} );
but it wasn't working, its showing a successful get but in my angular html page it is not accessing the data.
my html is something like:
<div class="row" ng-controller="oflClassCtrl">
<tr ng-repeat = "selectedClass in classes | filter:searchTxt">
<td><a ng-click="clickToOpen($index)">{{selectedClass.class}}</a></td>
the page renders correctly when i have the data in the controller but for some reason something is not working when i try to use the get request and $http service.
also im running a local host with php on xampp apache server so the $http should work right?