I try retrieving data from an api which is in xml format. I've source for few examples calling json file but couldn't get it done calling an api.
Here is my code. it shows nothing on the browser and It does not show any error in the console log
angular.module('myApp', [])
.controller('foodListController', function($scope, $http) {
$http.get('mydomain.com/api/FoodList/GetAllList').then(function (response) {
$scope.myData = response.data.dtoFood;
});
});
<ul>
<li ng-repeat="x in myData">
{{ x.FoodName + ', ' + x.IsActive }}
</li>
</ul>
<ArrayOfdtoFood>
<dtoFood>
<CreatedBy i:type="d3p1:string">1</CreatedBy>
<CreatedOn>2016-02-01T17:22:31.645Z</CreatedOn>
<IsActive>true</IsActive>
<IsChecked i:nil="true"/>
<IsDelete i:nil="true"/>
<ModifiedOn>2016-02-20T08:06:31.905Z</ModifiedOn>
<Modifiedby i:type="d3p1:string">1</Modifiedby>
<FoodName>Example1</FoodName>
</dtoFood>
<dtoFood>
<CreatedBy i:type="d3p1:string">1</CreatedBy> <CreatedOn>2016-02-01T17:22:31.645Z</CreatedOn>
<IsActive>true</IsActive>
<IsChecked i:nil="true"/>
<IsDelete i:nil="true"/>
<ModifiedOn>2016-02-20T08:06:31.905Z</ModifiedOn>
<Modifiedby i:type="d3p1:string">1</Modifiedby>
<FoodName>Example Food 2</FoodName>
</dtoFood>
</ArrayOfdtoFood>