angular-jsonapi icon indicating copy to clipboard operation
angular-jsonapi copied to clipboard

How to use JsonApi factory injected into controller

Open plwade opened this issue 10 years ago • 0 comments

@jakubrohleder We are using your JsonApi in a slightly different way to your Demo App. We are injecting an accounts resource factory (return $jsonapi.getResource('accounts')) into our controller and using accounts.all().promise to get a collection of accounts.

On the return of the promise, we populate our view model using vm.accountsList = accounts.cache.index(). Is this an acceptable way to use the JsonApi?

I know this is a different approach to your demo app, but we just want to make sure we are not making any fundamental mistakes. Any help appreciated. Regards, Paul

plwade avatar Dec 16 '15 19:12 plwade