Is it possible to load handlebar template with script tag? Or define handlebar templates programmatically in Ember.js

后端 未结 8 744
臣服心动
臣服心动 2021-01-31 10:38

Simply enough I do not want to define all my handlebar templates in my html file

I tried this



        
8条回答
  •  忘掉有多难
    2021-01-31 10:58

    It is possible, but you will need to precompile your templates first. This will also allow you to include all your templates within one file.

    • If you are using Rails, you can use the ember-rails gem to do it for you.
    • Otherwise you can follow these instructions on how to precompile handlebars

    Later on, you will need to include the javascript file.

    
    

提交回复
热议问题