ampersand-view
Advanced tools
Comparing version 5.1.4 to 5.1.5
@@ -286,3 +286,4 @@ var State = require('ampersand-state'); | ||
if (!template) throw new Error('Template string or function needed.'); | ||
var newDom = domify(_.isString(template) ? template : template(context || this)); | ||
var newDom = _.isString(template) ? template : template(context || this); | ||
if (_.isString(newDom)) newDom = domify(newDom); | ||
var parent = this.el && this.el.parentNode; | ||
@@ -289,0 +290,0 @@ if (parent) parent.replaceChild(newDom, this.el); |
{ | ||
"name": "ampersand-view", | ||
"description": "A smart base view for Backbone apps, to make it easy to bind collections and properties to the DOM.", | ||
"version": "5.1.4", | ||
"version": "5.1.5", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "browser": "./ampersand-view.js", |
@@ -606,1 +606,14 @@ var test = require('tape'); | ||
}); | ||
test('make sure template can return a dom node', function (t) { | ||
var Sub = AmpersandView.extend({ | ||
template: function () { | ||
return document.createElement('div'); | ||
} | ||
}); | ||
var view = new Sub(); | ||
view.render(); | ||
t.end(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53585
1094