Where to keep html templates?

。_饼干妹妹 提交于 2019-12-22 04:05:31

问题


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 them? but there is no acceptable answer.


回答1:


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.



来源:https://stackoverflow.com/questions/6188119/where-to-keep-html-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!