jakubrohleder / angular-jsonapi

Simple and lightweight, yet powerful ORM for your frontend that seamlessly integrates with your JsonAPI server.
http://jakubrohleder.github.io/angular-jsonapi/
GNU General Public License v3.0
96 stars 34 forks source link

Relationships fetching way #50

Open mabdurrehman opened 7 years ago

mabdurrehman commented 7 years ago

If I request on api URL http://localhost:3000/jobs/13/relationships/applicants in postman i get the required data. But I do not the way to get it in my angular (front-end) app. Consider a job & applicant models in my rails(back end)

I want to see who has applied for the job with id = X (let X = 2 ). I want to see list of applicant(s) for a job X

@jakubrohleder Its humbly requested to make demo simple and close to real world examples

pablorsk commented 7 years ago

@mabdurrehman we are working on ts-angular-jsonapi, maybe it's usefull for you.

mabdurrehman commented 7 years ago

@pablorsk Thanks for reply.

I have consulted a number of times https://github.com/reyesoft/ts-angular-jsonapi for my angular-jsonapi work and got idea/help how jsonapi works.

But I am unable to produce similar to

// mmmm, if I need get related resources? For example, books related with author 1
let relatedbooks = BooksService.all( { beforepath: 'authors/1' } );

Can you say something about it?

pablorsk commented 7 years ago

Sorry @mabdurrehman, I don't understand you.

You need to do something like

let relatedbooks = BooksService.all( { beforepath: 'authors/1' } );

but with this library?

Or you need help with ts-angular-jsonapi?