Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow viewdata to be 'namespaced'.

  • Loading branch information...
commit 039c4fa77cfc5422963b8ee995b702a128518334 1 parent f091b04
Matt Lee authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/josi/templating.js
2  lib/josi/templating.js
View
@@ -33,7 +33,6 @@ var TemplatingEngine = Class.extend({
callback(e);
}
if (master) {
- // fixme: don't clobber users' data
data.main = rendered;
self.load(master, function(masterTemplate) {
var rendered = masterTemplate(data);
@@ -55,6 +54,7 @@ this.MicroTemplatingEngine = TemplatingEngine.extend({
return new Function("obj",
"var __=[];" +
+ (this.namespace ? 'obj.' + this.namespace + ' = obj;' : '') +
// Introduce the data as local variables using with(){}
"with(obj){__.push('" +
Please sign in to comment.
Something went wrong with that request. Please try again.