Restangular doesn't work with normal API structures
I am looking into several supporting AngularJS libraries such as UI routes and other stuff. I started with Restangular today(https://github.com/mgonto/restangular).
I feel good with theory, but it adopts its own style of API URLs like the one below that return a response in square brackets ([]).
API:
Full demo:
We may not always depend on this restangled library, as many of the APIs may not follow such a structure if there is no need to use square brackets.
Ex: FaceBook API, below is an image with API responses that don't have [] at the beginning.
RestangularProvider.setBaseUrl (' https://api.mongolab.com/api/1/databases/angularjs/collections ');
My question is, can Restangular be used with any API answers.
source to share
yes, regarding the doc here https://github.com/mgonto/restangular#restangular-methods
while method .all(route)
expects response as an array [{}, {}, ..]
response descriptor .one(route, id)
or get()
as an object{"what": "ever"}
source to share