3 category: JavaScript libraries
10 App.Router.map(function() {
11 this.resource('trips', function() {
12 this.route('item', { path: '/:trip_id' });
15 this.route('upcoming');
16 this.route('about', { path: '/about' });
17 this.route('schedules');
18 this.route('history');
24 App.IndexRoute = Ember.Route.extend({
25 setupController: function(controller) {
26 controller.set('title', 'my app');
30 setupController: function(controller, model) {
31 controller.set("model", model);
32 this.controllerFor('topPost').set('model', model);
35 model: function(params) {
36 return this.store.find('posts');
37 return this.store.find('post', params.post_id);
40 serialize: function(model) {
41 // this will make the URL `/posts/foo-post`
42 return { post_slug: model.get('slug') };
48 App.InfoView = Ember.View.extend({
49 templateName: 'input', /* optional */
51 fooName: "Hello" /* {{ view.fooName }} */
61 <img {{bindAttr src="avatarURL"}}>
62 <button {{action follow}}>
66 {{view Ember.TextField class="input block" valuebinding="emailAddresses"}}
70 <button {{action invite emailAddresses}}>Invite></button>
72 <a href="#" {{action set "isEditingContacts" true target="view"}}