Expose Handlebars.precompile method from the compiler.
This commit is contained in:
@@ -673,5 +673,11 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
|
||||
})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
|
||||
|
||||
Handlebars.precompile = function(string, options) {
|
||||
var ast = Handlebars.parse(string);
|
||||
var environment = new Handlebars.Compiler().compile(ast, options);
|
||||
return new Handlebars.JavaScriptCompiler().compile(environment, options);
|
||||
};
|
||||
|
||||
// END(BROWSER)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user