简体   繁体   English

如何获得已编译的车把模板的来源?

[英]How can I get the source of a compiled handlebars template?

I'd like to modify a compiled Handlebars template, like: 我想修改一个已编译的Handlebars模板,例如:

var template = Handlebars.templates.my_path.to.original_template
var source = template.magic // ??
var modifiedTemplate = Handlebars.compile($(source).append('Also: {{something}}'))

There is apparently no way to get the source back without modifying Handlebars . 如果不修改Handlebars显然没有办法找回源代码。

Moreover, as we are using rails-handlebars , it would be even more involved. 而且,由于我们正在使用rails-handlebars ,因此会涉及更多。 :-( :-(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM