I am trying to fetch data from my own api but was not able to succeed in fetching the same to vegdata variable... here is the controller code
$scope.filterText = null;
$scope.vegdata =[];
$scope.init = function() {
url = "http://192.168.1.17\:5000/?callback=JSON_CALLBACK";
$http.jsonp(url).success(function(data){
console.log(data);
$scope.vegdata = data;
}).error(function(errord){
alert(errord);
});
JSOn format looks like below... the same I was able to fetch through browser
[{"name": "Tuar", "image": "0.0", "fat": "0.0", "alias": [{"vegname": "Tuar ", "language": "Hindi"}, {"vegname": "Red Gram", "language": "English"}, {"vegname": "Cajanus cajan", "language": "Botanical Name"}], "protein": "0.0", "energy": "0.0", "carbohydrates": "0.0"}]
http://192.168.1.17\:5000? It should behttp://192.168.1.17:5000.