Created
July 20, 2014 19:32
-
-
Save validkeys/dcf17ed0b460a0f933e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| `import Ember from 'ember'` | |
| PostRoute = Ember.Route.extend | |
| model: (params) -> | |
| @store.find('post', params.post_id) | |
| afterModel: (model) -> | |
| childPosts = [] | |
| @store.find('post', | |
| parent: model.get('id') | |
| iteration: @modelFor('iteration').get('id') | |
| ).then( (child_posts) -> | |
| childPosts = child_posts.get("content") | |
| model.get('posts') | |
| ).then( (posts) -> | |
| _.each childPosts, (cp) -> posts.pushObject cp | |
| ) | |
| setupController: (controller, model) -> | |
| controller | |
| .set('model', model) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment