Skip to content

Instantly share code, notes, and snippets.

@YuvrajKhavad
Last active October 24, 2020 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YuvrajKhavad/f37504d60d1a6b7e7e098e8a81923db4 to your computer and use it in GitHub Desktop.
Save YuvrajKhavad/f37504d60d1a6b7e7e098e8a81923db4 to your computer and use it in GitHub Desktop.
html2element: function(html) {
var $template, attributes = {},
template = html;
$template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) {
attributes[attr.name] = attr.value
}), this.$el.attr(attributes).html($template.html()), this.setContent(), this.renderContent()
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment