Global Handlebars.compile uses its env
The basic strategy is that there will be a global Handlebars object for the browser build, and that object will have a `compile` on it which uses its environment in the compiler. It will also be possible to glue things together manually by using the AMD build and passing the environment to `compile` directly. Some of these details are TBD.
This commit is contained in:
+5
-1
@@ -20,7 +20,11 @@ var create = function() {
|
||||
hb.SafeString = SafeString;
|
||||
hb.Exception = Exception;
|
||||
hb.Utils = { extend: extend, escapeExpression: escapeExpression, isEmpty: isEmpty };
|
||||
hb.compile = compile;
|
||||
hb.compile = function(input, options) {
|
||||
options = options || {};
|
||||
options.env = options.env || env;
|
||||
return compile(input, options);
|
||||
};
|
||||
hb.precompile = precompile;
|
||||
hb.template = template;
|
||||
hb.createFrame = createFrame;
|
||||
|
||||
Reference in New Issue
Block a user