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

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?

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

The UI template node looks like this :

<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}};">

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.

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"

1 Like