Handling dynamic segments inside routes
Using dynamic segments and dynamic models is an important aspect of routes. The following recipe will go over how this can be accomplished.
Getting ready
Before we begin our recipes, we'll need to set up a plugin called Ember CLI Mirage. Ember plugins, also known as add-ons, make it easy to share common code between applications. The Ember CLI Mirage plugin makes it easy to create a mock server so that we can develop, test, and prototype our data. We won't cover too much of this add-on in this chapter. If you'd like more information, you can download it at https://github.com/samselikoff/ember-cli-mirage.
In this example, we'll use the Ember Data's RESTAdapter, not the new JSON API adapter.
- In a new project, ...
Get Ember.js Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.