Backbone: managing templates

后端 未结 2 1910
终归单人心
终归单人心 2021-01-06 11:26

I\'m using underscore template engine for an backbone application. As of now I have over 15 templates in the . Its getting hard to maintain. So far,

2条回答
  •  花落未央
    2021-01-06 11:56

    Not sure what you mean by it being unmaintainable. Is it just a long list?

    You don't need to keep your templates in the head. They can be at the bottom of your body as well. They just need to be defined before you try to use them.

    One thing you might look into, depending on the server technology you are using would be to separate your templates into a different HTML file and include it at runtime.

提交回复
热议问题