Skip to content

Instantly share code, notes, and snippets.

@serenaf
Created Nov 7, 2017
Embed
What would you like to do?
Adding dynamic item route
import Route from '@ember/routing/route';
export default Route.extend({
model(params) {
return this.get('store').findRecord('item', params.id);
}
});
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
this.route('frontpage');
this.route('new');
this.route('jobs');
this.route('ask');
this.route('active');
this.route('show');
this.route('item', { path: '/item/:id' });
});
export default Router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment