3 category: JavaScript libraries
10 Router.map(function() {
11 this.route('trips', function() {
12 this.route('item', { path: '/:tripId' });
15 this.route('upcoming');
16 this.route('about', { path: '/aboutus' });
17 this.route('schedules');
18 this.route('history');
19 this.route('post', { path: '/post/:postId' });
24 import Route from '@ember/routing/route';
26 export default PostRoute extends Route {
28 // Post will be accessible as `this.model` in the controller
29 // or `{{@model}}` in the template.
30 return this.store.find('post', postId);
36 import Component from '@glimmer/component';
37 import { tracked } from '@glimmer/tracking';
39 export default PostEditor extends Component {
43 return `Post: ${title}`;
47 this.title = event.target.value;
54 <label for="title">Title</label>
58 {{on 'input' this.updateTitle}}
66 Invoking the component:
68 <PostEditor class='my-post' @post={{@model}} />