-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Carmen - completed wave 3 #34
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Carmen,
You've got an error here when you add a new Card, otherwise you have it done!. I've left some notes on where the error is.
}, | ||
|
||
showDetail: function(){ | ||
this.trigger( 'contactInfo', this.model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of Trigger!
|
||
addContact: function(contact){ | ||
var card = new ContactView({ | ||
model: contact, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably fix this line here so that the view's model is a Backbone Model object and not a generic JavaScript object.
|
||
render: function() { | ||
this.delegateEvents(); | ||
var html = this.template({name: this.model.get("name")}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error here, due to the fact that if you add a new card, the 'model' you've set for the view is a generic JavaScript object. You'll need to make a new model when you create the view for it to work.
ex: newCard = new Card( { model: new Contact(contact), template: this.contactTemplate });
No description provided.