Skip to content

Carmen - completed wave 3#34

Open
goaskcarmen wants to merge 4 commits intoAda-C6:masterfrom
goaskcarmen:master
Open

Carmen - completed wave 3#34
goaskcarmen wants to merge 4 commits intoAda-C6:masterfrom
goaskcarmen:master

Conversation

@goaskcarmen
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a 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);

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,

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")});

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 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants