How/Where to use Custom Handlbars Helpers in Stencil?

扶醉桌前 提交于 2019-12-12 02:49:14

问题


I'm familiar with how to code a custom Handlebars Helper, but where do I put the helper code within the files?

I've tried including my own JS file in the head and after the body, but I get the following error in the JS console:

Uncaught ReferenceError: Handlebars is not defined

Am I doing something wrong or is this a 'feature' of the Stencil implementation of Handlebars?

All help greatly appreciated!


回答1:


All the helpers are predefined that can be used with Stencil "natively". If you'd like to register your own, you'd need to include handlebars as apart of your theme and create them clientside.



来源:https://stackoverflow.com/questions/35580168/how-where-to-use-custom-handlbars-helpers-in-stencil

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!