Use Dynamic Segments Routing in Ember 2.0 without Data…
Dynamic segments are quite useful for any applications to give a better understanding for the user and for SEO plugins to make the site search engine friendly.
return this.store.findRecord(‘post’, param.post_id);In your router you have to define the routing map as
Router.map(function() {
this.route('public');
this.route('secure', function() {
this.route('print', {
path: 'print/:print_id'
});
});
});
or any way you prefer. Then use ember-cli to generate the router for the dynamic route
ember g route secure/print --path=:print_id
This will generate the following in the app path
and the main router will be modified. Specify this as route as you prefer. But I used the router map mentioned above as my application needed a separate path to print the reports generated by it.
So the URL should look like this http://localhost:4200/secure/print/print-order
In the print router modify the code as
In the print model you can use any design you want. But in my app I sent the component address resolved from the route and rendered the component in print.hbs. For this example I would just print the model parameters
–/print.hbs