{"action":"created","issue":{"url":"https://api.github.com/repos/mgonto/restangular/issues/961","labels_url":"https://api.github.com/repos/mgonto/restangular/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/mgonto/restangular/issues/961/comments","events_url":"https://api.github.com/repos/mgonto/restangular/issues/961/events","html_url":"https://github.com/mgonto/restangular/issues/961","id":50328025,"number":961,"title":"Is there a way to treat API query alias as not nested to make extendModel work?","user":{"login":"alejoromano","id":7268453,"avatar_url":"https://avatars.githubusercontent.com/u/7268453?v=3","gravatar_id":"","url":"https://api.github.com/users/alejoromano","html_url":"https://github.com/alejoromano","followers_url":"https://api.github.com/users/alejoromano/followers","following_url":"https://api.github.com/users/alejoromano/following{/other_user}","gists_url":"https://api.github.com/users/alejoromano/gists{/gist_id}","starred_url":"https://api.github.com/users/alejoromano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alejoromano/subscriptions","organizations_url":"https://api.github.com/users/alejoromano/orgs","repos_url":"https://api.github.com/users/alejoromano/repos","events_url":"https://api.github.com/users/alejoromano/events{/privacy}","received_events_url":"https://api.github.com/users/alejoromano/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-11-27T23:04:31Z","updated_at":"2015-07-07T00:12:23Z","closed_at":null,"body":"Hello,\r\n\r\nI'm using `extendModel()` to add a function to my `api/products` endpoint. This function returns extra data coming from the logged in user.\r\nI have this `baseProducts = Restangular.all('products');` restangular object for this endpoint \r\nI also have a query filter for featured products working as `api/products?featured=true`\r\nIf I do `baseProducts.getList({\"featured\": true});` the model is extendend and the function works perfectly.\r\n\r\nNow my question begins here,\r\nI would like to have my query filter work with an API alias as `api/products/featured`\r\nyet when I try to do the following `baseProducts.all('featured').getList();` or `baseProducts.customGET('featured');`\r\nI get the featured products, though the function added through`extendModel()` is not there. I'm not sure, but it seems this is because *featured* is treated as a nested entity instead of a parameter filtered query\r\n\r\nIs there any correct way to do this?\r\nThanks in advance"},"comment":{"url":"https://api.github.com/repos/mgonto/restangular/issues/comments/119032466","html_url":"https://github.com/mgonto/restangular/issues/961#issuecomment-119032466","issue_url":"https://api.github.com/repos/mgonto/restangular/issues/961","id":119032466,"user":{"login":"noahjcz","id":5472828,"avatar_url":"https://avatars.githubusercontent.com/u/5472828?v=3","gravatar_id":"","url":"https://api.github.com/users/noahjcz","html_url":"https://github.com/noahjcz","followers_url":"https://api.github.com/users/noahjcz/followers","following_url":"https://api.github.com/users/noahjcz/following{/other_user}","gists_url":"https://api.github.com/users/noahjcz/gists{/gist_id}","starred_url":"https://api.github.com/users/noahjcz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noahjcz/subscriptions","organizations_url":"https://api.github.com/users/noahjcz/orgs","repos_url":"https://api.github.com/users/noahjcz/repos","events_url":"https://api.github.com/users/noahjcz/events{/privacy}","received_events_url":"https://api.github.com/users/noahjcz/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T00:12:23Z","updated_at":"2015-07-07T00:12:23Z","body":"I have this exact problem as well.\r\n\r\nIt's a problem for extendModel, and also when crudding with an alias.\r\nas in I want...\r\nPUT api/products/123abc\r\n\r\nbut because of the featured thing, it goes to...\r\n\r\nPUT api/products/featured/123abc\r\n\r\nideally there would be something like: \r\n\r\n\r\nRestangular.all('products').alias('featured').getList()\r\n\r\nWhich would tell restangular that the model is \"products\", and that is also the base from which to send future CRUD."}}