Tag Archives: clean templates

No CSS, No HTML [p03]: Templates by HTML vs objects

20 Feb

Totty got tired because:

  1. Templates by HTML were dirty;
  2. Difficult to put UI logic in it;
  3. Has to be in sync with the client framework in order to make DOM queries;
Then he think and solved:
  1. Used templates by objects: you create an object in javascript and then it renders itself; This object usually contain other objects that render themselves; Until it reaches the most basic parts: buttons, texts, boxes, layouts…
  2. All the UI logic is written in pure javascript;
  3. He write once and render both on client and on server, therefore no DOM queries are needed;