9

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.

Community
  • 1
  • 1
Plastic Rabbit
  • 2,859
  • 4
  • 25
  • 27
  • By "no acceptable answer" do you mean "no generally accepted answer"? Or are you asking an alternative to the answers there which you consider unacceptable? – Mike Samuel Aug 07 '13 at 18:40

1 Answers1

7

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.

George Cummins
  • 28,485
  • 8
  • 71
  • 90
  • I really like this answer and referenced it in my answer to http://stackoverflow.com/questions/4719828/jquery-templates-where-should-i-put-them/7287029#7287029 – justis Sep 02 '11 at 17:21