i want to pass data using HTTP service call to the ionic project that am working with how to create a service request method to get data using HTTP ?
Use the AngularJS $http service.
1 Like
hope this piece of code helps you
.controller(‘Ctrl’,[‘$scope’,‘$http’,function($scope,$http){
$scope.contents=null;
$http.get(‘JSON Generator – Tool for generating random data’).then(function(resp){
$scope.contents=resp.data;
},
function(err){
console.error(‘ERR’,err);
});
}]);
1 Like