# Why does ng-click="send causes my other tags to lose reference?

**URL:** <https://discourse.nodered.org/t/why-does-ng-click-send-causes-my-other-tags-to-lose-reference/66035>\
**Category:** Dashboard\
**Created:** [4 August 2022 19:49 UTC](https://discourse.nodered.org/t/why-does-ng-click-send-causes-my-other-tags-to-lose-reference/66035 "2022-08-04T19:49:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wilay](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@Wilay](https://discourse.nodered.org/u/Wilay)\
**Post date:** [4 August 2022 19:49 UTC](https://discourse.nodered.org/t/why-does-ng-click-send-causes-my-other-tags-to-lose-reference/66035/1 "2022-08-04T19:49:52Z")

</div>

I have been having many issues lately, therefore thanks for everyone's massive help.

Basically, whenever I use ng-click="send({payload : msg.payload})" on my DIV element in my Template-UI node, or simply ng-click="send('Hello World')", it overrides the msg.payload that my Template received, and therefore breaks my UI that is dependent on the parts of the msg that it originally had. I am absolutely unable to get around this, despite the many codes and documentation I read.

Is there anyone that knows how it would be possible to send a msg.payload via ng-click without changing the node itself?

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [4 August 2022 19:55 UTC](https://discourse.nodered.org/t/why-does-ng-click-send-causes-my-other-tags-to-lose-reference/66035/2 "2022-08-04T19:55:42Z")

</div>

It will be better if you share the content of your template node including also the payload you are sending to that node.

---

<div class="post-metadata">

**Author:** ![Wilay](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@Wilay](https://discourse.nodered.org/u/Wilay)\
**Post date:** [4 August 2022 19:59 UTC](https://discourse.nodered.org/t/why-does-ng-click-send-causes-my-other-tags-to-lose-reference/66035/3 "2022-08-04T19:59:47Z")

</div>

The UI template node looks like this :

```auto
<div ng-click="send({payload : msg.client})" id = '{{msg.client}}' style = 'background-image : url("/{{msg.background}}") !important;'>
    <div class = clientStatus style = "background-color : {{msg.payload}};">
        <h3>{{msg.client}}</h3>
        <p>{{msg.topic}}</p>
    </div>
</div>

```

Basically, the msg includes a payload which is a background color, a .background that is a link, a .client that is a name, and a .topic that is the status. Everything works perfectly, as long as I don't use the send function.

---

<div class="post-metadata">

**Author:** ![Wilay](https://avatars.discourse-cdn.com/v4/letter/w/54ee81/32.png) [@Wilay](https://discourse.nodered.org/u/Wilay)\
**Post date:** [4 August 2022 20:09 UTC](https://discourse.nodered.org/t/why-does-ng-click-send-causes-my-other-tags-to-lose-reference/66035/4 "2022-08-04T20:09:13Z")

</div>

I have never considered this, but for everyone that this might help if they ever face the same problem as me :

The problem isn't in the code itself, but rather in the template node. Simply uncheck "Add output messages to stored state"  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6cc6010325b9db1f7f90ceb34599c21fceafbe5e.png)

---

<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:** [18 August 2022 20:09 UTC](https://discourse.nodered.org/t/why-does-ng-click-send-causes-my-other-tags-to-lose-reference/66035/5 "2022-08-18T20:09:23Z")

</div>

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