Routes in Ember represent each of the possible states in the application and are represented by the URL. Every route in Ember has a model, which is always kept in sync with the current URL. Ember allows you to specify a different root URL instead of the domain's root by setting the rootURL
property when creating a route, which allows applications to run in deeply nested domains.
As the application increases in size, you can set the LOG_TRANSITIONS
property to true
on the Ember.Application
instance that allows all routes to be logged in the console, which is great for debugging, or seeing the autogenerated routes that Ember produces.
To create a new route, use the ember:model subgenerator because it will generate all the necessary controllers, views, and routes. Open the terminal and execute the following command:
$ yo ember:model tag
This command will create the following:
Creates a new model class located at
app/scripts/models/tag_model.coffee
Creates a new controller...