How can I convert this REST call in angularJS from $http to $resource?
$http.get('https://url?&q={"last-name":"Harris"}')
.success(function (restData) {
$rootScope.resp = restData;
});
How can I convert this REST call in angularJS from $http to $resource?
$http.get('https://url?&q={"last-name":"Harris"}')
.success(function (restData) {
$rootScope.resp = restData;
});
Thy this:
$resource('https://url?&q={"last-name":"Harris"}').get(function(response){});
I was expecting that I could simply supply additional query selection criteria using $resource, but I think the RESTful API only allows such selection through the &q= param in the url.
So, I'll use examples from the link below and build my own little factory to give me the flexibility that allows me manipulate the url and select records using any desired field, and not only by the unique record :id https://docs.angularjs.org/api/ngResource/service/$resource
Will post an update here as my understanding is further enhanced.