Button with template node, send input msg to output with ng-click

I have button-template node that works well for me, but now I want to send the payload part of the input-msg together with the output-msg on ng-click. I searched all the relevant subject on this, but never found the right answer. Maybe someone can help.

I have this so far in the template node:

<md-button class="vibrate filled touched smallfont rounded" 
   style="background-color: {{msg.backcolor}}; color: {{msg.fontcolor}};" 
   ng-bind-html="msg.buttonname"
   ng-click="send({action: 'click' , topic: '{{msg.buttonname}}' })">
</md-button>

The only thing that's not working here is the msg.buttonname, that is part of the input-msg, I want that added to the output-msg, as topic. In this case the template node treats it like text.

Ok, after many trials I found it by accident.

<md-button class="vibrate filled touched smallfont rounded" 
    style="background-color: {{msg.backcolor}}; color: {{msg.fontcolor}};" 
    ng-bind-html="msg.buttonname"
    ng-click="send({action: 'click' , topic: msg.buttonname })">
</md-button>

This is working for me now!!!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.