refactor: merge render register into scope

This commit is contained in:
harttle
2016-11-06 15:22:29 +08:00
parent 258f4a2073
commit d7b7b1724f
8 changed files with 21 additions and 30 deletions
+1 -9
View File
@@ -38,15 +38,7 @@ var _engine = {
return this.parser.parse(tokens);
},
render: function(tpl, ctx, opts) {
opts = _.assign({
strict_variables: false,
strict_filters: false,
root: []
}, opts);
this.renderer.initRegister(opts);
var scope = Scope.factory(ctx, {
strict: opts.strict_variables,
});
var scope = Scope.factory(ctx, opts);
return this.renderer.renderTemplates(tpl, scope);
},
parseAndRender: function(html, ctx, opts) {