Closed marklagendijk closed 2 years ago
Thank you. This looks interesting. It will take a bit of time for me to dig into it and consider a v2.
Since I posted this, I have applied this approach to a project which I am working on, and it is working great!
Some examples:
// GET
$scope.myEntities = myApi
.all('myPlugin/myEntities')
.getList()
.$object;
// POSTing a form
if($scope.myForm.$valid){
myApi.all('myPlugin/myEntities')
.post($scope.myEntity)
.then(function(){
$scope.saved = true;
});
}
The current approach with ngResource forces you to use the ugly
:param1/:param2
approach. I think it would be better to use Restangular instead. With Restangular you could create a service like this:And then use it like this (example taken from Restangular README):