{"action":"opened","issue":{"url":"https://api.github.com/repos/Netflix/falcor/issues/587","labels_url":"https://api.github.com/repos/Netflix/falcor/issues/587/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/falcor/issues/587/comments","events_url":"https://api.github.com/repos/Netflix/falcor/issues/587/events","html_url":"https://github.com/Netflix/falcor/issues/587","id":113161012,"number":587,"title":"Support for generating sub models","user":{"login":"Pajn","id":817422,"avatar_url":"https://avatars.githubusercontent.com/u/817422?v=3","gravatar_id":"","url":"https://api.github.com/users/Pajn","html_url":"https://github.com/Pajn","followers_url":"https://api.github.com/users/Pajn/followers","following_url":"https://api.github.com/users/Pajn/following{/other_user}","gists_url":"https://api.github.com/users/Pajn/gists{/gist_id}","starred_url":"https://api.github.com/users/Pajn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pajn/subscriptions","organizations_url":"https://api.github.com/users/Pajn/orgs","repos_url":"https://api.github.com/users/Pajn/repos","events_url":"https://api.github.com/users/Pajn/events{/privacy}","received_events_url":"https://api.github.com/users/Pajn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-24T13:46:14Z","updated_at":"2015-10-24T13:46:14Z","closed_at":null,"body":"It would be nice if Falcor had support for generating sub-models where paths are not relative to the root.\r\nFor example a movieDetail page needs knowledge of the full path to the movie, which usually includes an ID.\r\nIf I could generate a sub-model with points to the movie object directly it would only need knowledge of the properties of movie. It doesn't even need to know the id or if the movie is queried by the id, it would be just as glad if this later on changed to a slug.\r\n\r\nExample:\r\n```\r\nconst rootModel = new falcor.Model(...);\r\nconst movieModel = rootModel.subModel(['moviesById', 5]);\r\n\r\nmovieModel.get('name').then((response) => console.log('You are watching', response.name));\r\n```\r\n\r\nAs you see, both the get request path and response is relative to the path `['moviesById', 5]`"}}