Skip to content

Instantly share code, notes, and snippets.

@shortly-portly
Created August 24, 2015 05:59
Show Gist options
  • Save shortly-portly/82e62ed5ecb82e9bfb1d to your computer and use it in GitHub Desktop.
Save shortly-portly/82e62ed5ecb82e9bfb1d to your computer and use it in GitHub Desktop.
// My User List View
module.exports = View.extend({
template: require('../templates/userList.jade'),
autoRender: true,
render: function() {
this.renderWithTemplate();
this.renderCollection(
this.collection,
userDetail,
this.el.querySelector('.itemContainer'))
}
})
// My User Detail View
module.exports = View.extend({
template: require('../templates/userDetail.jade'),
autoRender: true,
bindings: {
'model.firstName': {
type: 'text',
hook: 'firstName'
},
'model.lastName': {
type: 'text',
hook: 'lastName'
},
'model.admin': {
type: 'text',
hook: 'admin'
}
}
})
// My User List Template
div.container
div.well
h3 List Users
table.table
tr
th First Name
th Last Name
th Admin
tr.itemContainer
// My User Detail Template
<WHAT GOES HERE????>
td(data-hook='firstName')
td(data-hook='lastName')
td(data-hook='admin')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment