You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to add directives to expressions in a similar fashion to how modifiers are executed against values now. My particular use case (see code below) would be to support nested templates.
Template:
<strong>{{ list.name }}</strong>
<ulclass="things">
{% for thing in list.things|attachThings %}
<liclass="thing {{thing.class}}">
</li>
{% endfor %}
</ul>
Javascript:
varthingTemplate='Thing: {{thing.name}}';varlist={name: 'Test List',things: [{name: 'testThing1',class: 'textThing1Class'},{name: 'testThing2',class: 'textThing2Class'}]}Ashe.addDirectives({attachThings: function(values){values.forEach(function(v){// key `thing` equal to `thing` in loop.v.thing;// key `template` is `Array` containing elements inside loop,v.template;varelement=$('.thing',template);varcontent=Ashe.parse(thingTemplate,thing);element.html(content);});}// , oneMoreDirective: function(values) { ... }});
What are you thoughts on this being included in Ashe?
The text was updated successfully, but these errors were encountered:
This looks nice. However I'm a little tight on time in the moment. So not sure if I will support Ashe at all. There are better options like Handelbars I believe.
I'd like to be able to add directives to expressions in a similar fashion to how modifiers are executed against values now. My particular use case (see code below) would be to support nested templates.
Template:
Javascript:
What are you thoughts on this being included in Ashe?
The text was updated successfully, but these errors were encountered: