Quantcast
Channel: User Sneaky Toes - Stack Overflow
Viewing all articles
Browse latest Browse all 20

AngularJs, Django RESTful and Restangular: Consuming an array of hyperlinks

$
0
0

I'm having trouble configuring restangular to consume a list of api urls in my response object.

Currently, my object response looks like:

{    folders: ['http://localhost:8000/api/folder/1', 'http://localhost:8000/api/folder/2','http://localhost:8000/api/folder/3']}

but i want it to return the folder objects

{    folders: [{                  files: ['http://localhost:8000/api/file/1''http://localhost:8000/api/file/2']              },               {                  files: ['http://localhost:8000/api/file/3']              },              {                  files: ['http://localhost:8000/api/file/4']              }]}

(and then eventually the file objects inside the folder objects):

{    folders: [{                  files: [{},{}]              },               {                  files: [{}]              },              {                  files: [{}]              }]}

How can I configure restangular through addResponseInterceptor or other means to consume the array of nested hyperlinks


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>