{"action":"created","issue":{"url":"https://api.github.com/repos/io-informatics/angular-jsonld/issues/2","labels_url":"https://api.github.com/repos/io-informatics/angular-jsonld/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/io-informatics/angular-jsonld/issues/2/comments","events_url":"https://api.github.com/repos/io-informatics/angular-jsonld/issues/2/events","html_url":"https://github.com/io-informatics/angular-jsonld/issues/2","id":67907628,"number":2,"title":"Ease collection handling","user":{"login":"astik","id":572233,"avatar_url":"https://avatars.githubusercontent.com/u/572233?v=3","gravatar_id":"","url":"https://api.github.com/users/astik","html_url":"https://github.com/astik","followers_url":"https://api.github.com/users/astik/followers","following_url":"https://api.github.com/users/astik/following{/other_user}","gists_url":"https://api.github.com/users/astik/gists{/gist_id}","starred_url":"https://api.github.com/users/astik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astik/subscriptions","organizations_url":"https://api.github.com/users/astik/orgs","repos_url":"https://api.github.com/users/astik/repos","events_url":"https://api.github.com/users/astik/events{/privacy}","received_events_url":"https://api.github.com/users/astik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-12T12:13:38Z","updated_at":"2015-04-13T07:31:54Z","closed_at":null,"body":"I have a factory :\r\n\r\n```\r\nmodule.factory('siteService', function($q, $log, JsonldRest) {\r\n\tvar api = {};\r\n\r\n\tJsonldRest.setBaseUrl('/api/v1/');\r\n\tvar entitiesHandler = JsonldRest.collection('sites');\r\n\r\n\tapi.findAll = function() {\r\n\t\t$log.log('siteService.findAll');\r\n\t\treturn entitiesHandler.getList();\r\n\t};\r\n\r\n\treturn api;\r\n});\r\n```\r\n\r\nWhile using the findAll function, I get this error :\r\n\r\n```\r\nError: Response for getList SHOULD be an array and not an object or something else\r\n```\r\n\r\nThis is completely normal as the JSON is like :\r\n```\r\n{\r\n  \"@context\":\"/contexts/Site\",\r\n  \"@id\":\"/sites\",\r\n  \"@type\":\"hydra:PagedCollection\",\r\n  \"hydra:totalItems\":14,\r\n  \"hydra:itemsPerPage\":30,\r\n  \"hydra:firstPage\":\"\\/sites\",\r\n  \"hydra:lastPage\":\"\\/sites\",\r\n  \"hydra:member\":[\r\n   {\"@id\":\"/sites/1\",\"@type\":\"Site\",\"lang\":\"es\"},\r\n   {\"@id\":\"/sites/2\",\"@type\":\"Site\",\"lang\":\"en\"}\r\n  ]\r\n}\r\n```\r\n\r\nIt is clear I need to work with \"hydra:member\". But I'd really like a simple way to manipulate the list.\r\n\r\n@dunglas has a sweet approach to that :\r\nhttps://github.com/dunglas/DunglasJsonLdApiBundle#angularjs-integration\r\n\r\nWhat I like is that we can manipulate directly the list (this is what is recommended by mgonto in its demo slide), but, in addition to that, we keep the pagination meta data.\r\n\r\nI would be great to have this add-on directly into angular-jsonld in idea to have less code to bootstrap (I know, I'm lazy =P)\r\n"},"comment":{"url":"https://api.github.com/repos/io-informatics/angular-jsonld/issues/comments/92251344","html_url":"https://github.com/io-informatics/angular-jsonld/issues/2#issuecomment-92251344","issue_url":"https://api.github.com/repos/io-informatics/angular-jsonld/issues/2","id":92251344,"user":{"login":"alexdeleon","id":648720,"avatar_url":"https://avatars.githubusercontent.com/u/648720?v=3","gravatar_id":"","url":"https://api.github.com/users/alexdeleon","html_url":"https://github.com/alexdeleon","followers_url":"https://api.github.com/users/alexdeleon/followers","following_url":"https://api.github.com/users/alexdeleon/following{/other_user}","gists_url":"https://api.github.com/users/alexdeleon/gists{/gist_id}","starred_url":"https://api.github.com/users/alexdeleon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexdeleon/subscriptions","organizations_url":"https://api.github.com/users/alexdeleon/orgs","repos_url":"https://api.github.com/users/alexdeleon/repos","events_url":"https://api.github.com/users/alexdeleon/events{/privacy}","received_events_url":"https://api.github.com/users/alexdeleon/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T07:31:54Z","updated_at":"2015-04-13T07:31:54Z","body":"Hi Romain, \r\nI have the code to handle hydra collections in another library. You are right, It makes sense to have here in angular-jsonld. I will put it up and let you know.\r\n\r\n"}}