handlebars-lang / handlebars.js

Minimal templating on steroids.
http://handlebarsjs.com
MIT License
17.93k stars 2.04k forks source link

Add ability to clone HBS instance #1183

Open devinus opened 8 years ago

devinus commented 8 years ago

This would allow us to register partials and helpers on a global instance and clone it to modify the environment for another use case.

nknapp commented 8 years ago

Have a look at Handlebars.create(). I believe it does exactly that.

devinus commented 8 years ago

Handlebars.create() creates a new environment, but I'm looking for a method to clone an existing environment without setting up all it's helpers and partials and decorators again.

nknapp commented 8 years ago

Sorry, I thought it would copy helpers and partials as well. But it doesn't.