I've tried to set dynamically UI template button onclick attribute value using mustache syntax (myfunction is intended to be executed in browser). I've got parse syntax error, any hints ?
Thank's
Function node:
msg.my_onclickfunction = "myfunction()";
or
msg.my_onclickfunction = "\"myfunction()\"";
return msg;
Function node msg.my_onclickfunction = "myfunction()";
UI template node
i've got parse error with Devtools on: <button onclick="{{{msg.my_onclickfunction}}}"></button>
Error: $parse:syntax
Syntax Error
Syntax Error: Token '.' is unexpected, expecting [}] at column 5 of the expression [{msg.my_onclickfunction] starting at [.my_onclickfunction].
and compile error on alternative: <button onclick={{msg.my_onclickfunction}}></button>
Error: $compile:nodomevents
Event Attribute/Property Binding
Interpolations for HTML DOM event attributes are disallowed
My goal is mainly to factorize UI templates (calling external javascript and css static ressources in browser) using only a subflow vs several statics ui templates.
However Function node msg.my_color = "color: green"; UI template node <p style={{msg.my_color}}>my text</p>
OK and also Function node msg.my_id = "test"; UI template node <button id={{msg.my_id}}></button>
is OK too !
i'm quite a newbie with node and vue but very impressed on NR capabilities. Any workaround to bind DOM events ?
Steve, i will look at your UI button management examples.
Difficult for me to share code now but i will try to clean it from "private" elements (logins, url's etc ..) and post here.
My current code (web radio player with metadata and covers) is quite functional for my use. I'm trying to factorize to enhance "maintenability". Thank's again for you help, i've a lot to learn.