Last active
March 23, 2016 02:35
-
-
Save koemeet/8daaa5b674fe7902241a to your computer and use it in GitHub Desktop.
This file contains 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
// routes/company/clients.js | |
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model(params) { | |
let company = this.modelFor('company'); | |
// this | |
return this.get('store').query('client', { | |
company: company.get('id') | |
}); | |
// or simply do this | |
return company.get('clients'); | |
} | |
}); |
This file contains 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
// routes/company.js | |
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model(params) { | |
return this.get('store').findRecord('company', params.company_id); | |
} | |
}); |
This file contains 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
this.route('company', { path: '/company/:company_id' }, () => { | |
this.route('clients'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment