Allow _.templateSettings to be overriden.

This commit is contained in:
Brad Dunbar
2012-04-03 17:38:39 -07:00
parent b04b813f02
commit 89c50e1a95
2 changed files with 9 additions and 6 deletions

View File

@@ -179,8 +179,11 @@ $(document).ready(function() {
});
test('_.templateSettings.varname', function() {
var s = '<%=data.x%>';
var data = {x: 'x'};
strictEqual(_.template(s, data, {varname: 'data'}), 'x')
_.templateSettings.varname = 'data';
strictEqual(_.template('<%=data.x%>')({x: 'x'}), 'x');
strictEqual(_.template(s)(data), 'x')
});
});