开发者

Where to keep html templates?

I have a single page app. Currently my templates stored in index.html e.g.

 <script id="button" type="text/html">
    <a class="button" href="#" id="${id}">
       ${value}
    </a>
 </script>

Is it a best practice to store them in such way? I've found jQuery templates - where should I put t开发者_StackOverflow社区hem? but there is no acceptable answer.


You are doing it right. There is no need to add unnecessary complexity to a single-page app, according to the KISS principle:

Most systems work best if they are kept simple rather than made complex; therefore simplicity should be a key goal in design and unnecessary complexity should be avoided.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜