3 category: JavaScript libraries
6 archived: This sheet describes an older version of Ember.
13 Router.map(function() {
14 this.route('trips', function() {
15 this.route('item', { path: '/:tripId' });
18 this.route('upcoming');
19 this.route('about', { path: '/aboutus' });
20 this.route('schedules');
21 this.route('history');
22 this.route('post', { path: '/post/:postId' });
27 import Route from '@ember/routing/route';
29 export default PostRoute extends Route {
31 // Post will be accessible as `this.model` in the controller
32 // or `{{@model}}` in the template.
33 return this.store.find('post', postId);
39 import Component from '@glimmer/component';
40 import { tracked } from '@glimmer/tracking';
42 export default PostEditor extends Component {
46 return `Post: ${title}`;
50 this.title = event.target.value;
57 <label for="title">Title</label>
61 {{on 'input' this.updateTitle}}
69 Invoking the component:
71 <PostEditor class='my-post' @post={{@model}} />