Emberjs Handlebars precompiling

前端 未结 6 2218
庸人自扰
庸人自扰 2020-12-23 14:44

My Emberjs app is running slowly so I wanted to precompile my template to ease the runtime a bit. However I\'m lost on how to proceed. I read http://handlebarsjs.com/precomp

6条回答
  •  情话喂你
    2020-12-23 15:02

    You can set the precompiled handlebars output to the template property (not templateName) on you ember view. This is what ember also does under the hood

    MyApp.MyView = Ember.View.extend({
      templateName: "myViewWhatever",
      template: Ember.Handlebars.compile('

    {{blah}}

    '), })

提交回复
热议问题