3 ms·
The template being inline is a bug, not a feature in my opinion. You can actually write arbitrary templates into HTML using <script type='text/template'> (or re
by mediumdeviation 10y ago
The template being inline is a bug, not a feature in my opinion. You can actually write arbitrary templates into HTML using <script type='text/template'> (or really any type other than 'javascript'), and with a simple function get ~90% of the power of template strings in languages such as ES6 or Python. Writing your templates into JS like that is plain ugly and unmaintainable.
- fnaticshank 10y agoI agree writing templates into JS like that is plain ugly. Using HTML5 template[1] tag is a better way to go. I used it in a fun project[2] and it works flawlessly in all modern browsers [1]: https://developer.mozilla.org/en/docs/Web/HTML/Element/template https://developer.mozilla.org/en/docs/Web/HTML/Element/templ... [2]: https://github.com/shashankgroovy/notif https://github.com/shashankgroovy/notif
- bunnybender 10y ago[2] works better with the y at the end ;-) https://github.com/shashankgroovy/notify https://github.com/shashankgroovy/notify
- pyre 10y agoCould just be the next iteration of Motif[1]... ;-) [1] https://en.wikipedia.org/wiki/Motif_(software) https://en.wikipedia.org/wiki/Motif_(software)
- boramalper 10y agoI agree, but I didn't know any such solution while developing it. I'll probably switch to a client-side templating library.