Kode
Kode

Reputation: 3215

Externalizing HTML Templates in Backbone: Pros/Cons

What are the pros/cons of externalizing HTML templates in Backbone? Are there any best practices (ex. don't do it in production!).

Thanks.

Upvotes: 0

Views: 62

Answers (1)

Griffin M
Griffin M

Reputation: 461

To me the biggest advantage is that external templates can be used in javascript tests as fixtures. It also makes them modular so they can be used by more than 1 view. The only downside I can think of is that fact that an extra HTTP request has to made to download the template. However this could be solved using a proper build process for your AMD library.

Upvotes: 1

Related Questions