mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Add varname to _.templateSettings.
* Leave out the with statement when using varname. * Rename source to compiled. * Comments, comments, comments.
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
var templateSettings = _.templateSettings;
|
||||
var templateSettings;
|
||||
|
||||
module("Utility", {
|
||||
|
||||
setup: function() {
|
||||
templateSettings = _.clone(_.templateSettings);
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
_.templateSettings = templateSettings;
|
||||
}
|
||||
@@ -174,4 +178,9 @@ $(document).ready(function() {
|
||||
strictEqual(_.result(null, 'x'), null);
|
||||
});
|
||||
|
||||
test('_.templateSettings.varname', function() {
|
||||
_.templateSettings.varname = 'data';
|
||||
strictEqual(_.template('<%=data.x%>')({x: 'x'}), 'x');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user