Skip to content

Instantly share code, notes, and snippets.

@daffl
Created June 12, 2014 18:59
Show Gist options
  • Select an option

  • Save daffl/1c294158a0d4c55afab4 to your computer and use it in GitHub Desktop.

Select an option

Save daffl/1c294158a0d4c55afab4 to your computer and use it in GitHub Desktop.
can.Application concept
can.Application.extend({
template: can.view('index.stache'),
content: '#content',
state: {
},
routes: {
empty: function(data) {
},
notFound: function(data) {
},
'post/:id': {
template: '<blog-post post="{post}"></blog-post>',
set: function(data) {
this.attr('post', Post.findOne({ id: data.id }));
this.attr('messages', Messages.findAll({ post: data.id }));
}
},
'user/:id/account': {
template: can.view('account.mustache'),
set: function(data) {
this.attr('user', User.findOne({ id: data.id }));
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment