Struggling to retrieve json data. Initially, I created an ajax request that functioned properly in a regular html page but failed in my angular app. As a result, I decided to experiment with the built-in $http get function. Surprisingly, no errors are thrown, however, the ajax data fails to load, even though the console log confirms that the GET request was successful.
When directly visiting the php file, it displays an encoded json object array without any issues.
Here is how my controller is structured:
apDash.controller('fieldopmgrController', function($scope,$http){
$http.get('protected/getHeadObs.php')
.success(function(data, status, headers, config) {
$scope.flights = data.flightid;
});
});
This is how my view appears:
<div class="small-5 columns">
<label>Flight ID
<select name="fliID" class="radius">
<option ng-repeat="flight in flights">{{flight.flightid}}</option>
</select>
</label>
</div>
The structure of my json data is as follows:
image updated!
Although no errors are being reported in the console log, the view remains unresponsive. I've been experimenting with AngularJS for a few months now, but this is my first encounter with the $http service. Any guidance or advice on what might be going wrong would be greatly appreciated. Thank you in advance.