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
{{ message }}
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
@dgreensp This is a bug with the $specials field. The compiler seems to expect this field to be an array (in the AST) and it doesn't work with a non-array value. This behavior is inconsistent with the other constructors.
// First case: $specials value wrapped in an arraySpacebars.codeGen(HTML.P({"$specials": [HTMLTools.Special(Spacebars.TemplateTag.parse('{{xxx}}'))]}));// This works as expected and returns'(function() { var self = this; return HTML.P({ $dynamic: [ function() { return Spacebars.mustache(self.lookup("xxx")); } ] });})'// Second case: $specials value NOT wrapped in an arraySpacebars.codeGen(HTML.P({"$specials": HTMLTools.Special(Spacebars.TemplateTag.parse('{{xxx}}'))}));// returns'(function() { var self = this; return HTML.P();})'// instead of'(function() { var self = this; return HTML.P({ $dynamic: function() { return Spacebars.mustache(self.lookup("xxx")); } });})'
BTW I think that the array optimization (ie don't use an array if there is only one value and merge consecutive strings) should be done by the compiler.
Hi! I still have an issue. I try to pass attributes to div: .post($dyn=attributes), where attributes are {class: "post animate", style: "top: 0px"}. But I get an error:
Error: Illegal HTML attribute name: 0
The error is thrown by extendAttrs function, which gets string "[object Object]", as src argument instead of an actual object. This seems to be done by Spacebars.mustache function.
Hey I am sorry if I might me doing this wrong but I have been trying to get dynamic helper to work.
What I am doing is have a helper named attrs return an object {type: 'text', placeholder: 'hello'}
to the template that has input($dyn = attrs)
If this is not the way to use dynamic template, please point me to the right way.
The text was updated successfully, but these errors were encountered: