Closed freejacque closed 10 years ago
Hi Jackie! You didn't actually add your code. Can you push your project currently and paste into this issue the:
javascript.js
function Card(element){ this.element = element; // this.atomicNumber = element.atomicNumber; // this.name = element.name; // this.symbol = element.symbol; // this.electronConfiguration = element.electronConfiguration; // this.category = element.category; // this.charge = element.charges[0]; // this.charge2 = element.charges[1]; }
Card.prototype = { template: _.template($("#card-template").html()),
render: function(){
console.log(' view:render', this);
var temp = this.template({element: this.element});
this.$element = $(temp);
return this;
},
init: function(){
console.log(' view:init', this);
var view = this;
if (!this.$element){
view.render();
$("#card").append(view.$element);
console.log(this.$element);
}
},
};
index.html
<!doctype html>
```I'm not sure if I do have the code that is rendering the template because I don't understand how it works.
Cool. Remember to put the code in code brackets like this:
```ruby
...
...
... or ...
<p>HTML goes here!</p>
Now -- I need you to do that with your HTML. Markdown renders HTML as is, so I can't actually see your code!
Example:
Coolio.
I'm trying to use todo.ly as an example but I still don't completely understand how it works. I could use some guidance on getting the template to render objects. this is my template: