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('home'); this.route('about'); this.route('contact'); }); export default Router;
import Route from '@ember/routing/route'; export default Route.extend({ actions: { goToAbout() { this.transitionTo('about'); } } });This example demonstrates how to handle route transitions in Ember Router using the `this.transitionTo()` method. In this case, clicking a button with the `goToAbout` action will transition the user to the `about` route. Package library: '@ember/routing'