Backbone.js : a Simple render function -
I am learning Backbone.js, I can not find this code that what is wrong with this code:
NView = Backbone.View.extend ({tagname: 'span', render: function () {$ (this.el) .html ('& lt; h3 & gt;' + this.model .get ('comments') + This.model.get ('min') + '');}}); NewView = New NView ({Model: NModelo}); NewView.render (); Console.log (newView.el);
I think this is supposed to be logged in:
& lt; Span & gt; & Lt; H3 & gt; .... & lt; / H3 & gt; & Lt; / Span & gt;
But this is just a & lt; Span & gt; & Lt; / Span & gt;
, nothing between tags, why?
L
property is a DOM element, string is not obtained to get full HTML string To do this, you can use the external HTML
property:
console.log (newView.el.outerHTML);
Comments
Post a Comment