Node.js with Handlebars.js on server and client

前端 未结 7 2464
抹茶落季
抹茶落季 2020-12-02 08:21

I have an app in Node.js using Expressjs and Handlebars as the template engine.

Expressjs uses layouts and then renders views. The layout (layout.hbs) looks like th

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 08:26

    You have 2 options. The second is THE best way to go:

    1) Escape the mustaches

    
    

    2) Precompile

    This will compile the template on the server before it goes to the client. This will make the template ready to use and reduces the burden on the browser.

提交回复
热议问题