Conversation
There was a problem hiding this comment.
Can we just check for __obj.length and __obj.join here instead?
There was a problem hiding this comment.
Absolutely, that might be better. A bit crazy that typeof array is broken.
|
It seems nice, but I kind of like restricting the template context to an object. Not a strong opinion though. |
|
@sstephenson worth me refactoring the array check? Is this something you'd like to see in core? @josh - the template context will still be an object, the array index. |
|
+1. I ended up writing myself a helper function to template an array at first (this is what i was used to from other libraries). Since then i've been been doing |
Not sure if you want this in core, but it lets you pass an array to eco(), instead of an object, rendering the template over each item in the array. This is the standard in other templating libs, like jQuery.tmpl.