The EmberJs router, and its associated routing concepts, are significantly more complex than those of AngularJs:
Router
and Route
objectsThis added complexity makes for a steeper learning curve at first, but pays off afterwards, as it supports a richer set of features.
Syntax:
App.Router.map(function() {
this.resource('foos', function() {
this.route('foo', { path: '/:foo_id' });
});
this.route('bar');
});
You might be wondering, but where are the controllers, views, and models named? To make sense of the syntax for the router, it is first necessary to understand EmberJs' philosophy on convention over configuration - and in particular, its naming conventions.