3 ms·
High quality code. Good job! Template engines allow you to reuse template as functions. I do not believe this system promotes reusable markup. If this is inten
by jimmyhchan 14y ago
High quality code. Good job!
Template engines allow you to reuse template as functions. I do not believe this system promotes reusable markup. If this is intended for simple static HTML, I would rather use static HTML -- pre-generated using HAML or mustache.
Determine the global object: why not just pass this into your closure function?
- jedschmidt 14y agoPut your domo code into a function that takes data and returns a DOM object. BAM, there's your template. Your JavaScript code can only have one global object, I don't see a reason to pass it in instead of finding it for you.