1

This is the url I am working with: http://103.13.75.21:8081/product

I have tried:

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
  $http({
    method : "GET",
    url : "http://103.13.75.21:8081/product"
  }).then(function mySucces(response) {
      $scope.myWelcome = response.data;
    }, function myError(response) {
      $scope.myWelcome = response;
  });
});
</script>

{"data":null,
 "status":-1,
 "config":{"method":"GET","transformRequest"[null],
 "transformResponse":[null],
  "url":"http://103.13.75.21:8081/product","headers":{"Accept":"application/json, text/plain, */*"}},"statusText":""}

May I know how to get product id by using $resource or $http?

Pritam Banerjee
  • 17,953
  • 10
  • 93
  • 108
Danson Yap
  • 11
  • 1

0 Answers0