Open
Conversation
CheezItMan
reviewed
Dec 16, 2016
CheezItMan
left a comment
There was a problem hiding this comment.
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); |
|
|
||
| addContact: function(contact){ | ||
| var card = new ContactView({ | ||
| model: contact, |
There was a problem hiding this comment.
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.
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 });
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.