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

**URL:** <https://discourse.nodered.org/t/button-with-template-node-send-input-msg-to-output-with-ng-click/75511>\
**Category:** Dashboard\
**Created:** [21 February 2023 13:44 UTC](https://discourse.nodered.org/t/button-with-template-node-send-input-msg-to-output-with-ng-click/75511 "2023-02-21T13:44:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [21 February 2023 13:44 UTC](https://discourse.nodered.org/t/button-with-template-node-send-input-msg-to-output-with-ng-click/75511/1 "2023-02-21T13:44:37Z")

</div>

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:

```auto
<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.

---

<div class="post-metadata">

**Author:** ![henkkas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henkkas/32/39844_2.png) [@henkkas](https://discourse.nodered.org/u/henkkas)\
**Post date:** [21 February 2023 13:58 UTC](https://discourse.nodered.org/t/button-with-template-node-send-input-msg-to-output-with-ng-click/75511/2 "2023-02-21T13:58:29Z")

</div>

Ok, after many trials I found it by accident.

```auto
<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!!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 March 2023 13:58 UTC](https://discourse.nodered.org/t/button-with-template-node-send-input-msg-to-output-with-ng-click/75511/3 "2023-03-07T13:58:45Z")

</div>

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