Simple debugging of Dashboard Widget

Hey Colin,

We will have to analyse it step by step ...
When you look at the node-red-contrib-ui-led code, you will see that the 'update' function is called as soon as a message arrives:

$scope.$watch('msg', update);

The dashboard handles automatically all the message communication for you, and stores the message on the AngularJs scope (see drawing here). As soon as the msg on the scope is updated, the watch will detect the change an execute the 'update' callback function ...

So if I were you, I would add a debugger statement in that function:

var update = (msg) => {
         debugger;
         if (!msg) {
	       return;
	 }

If you open the developer tools of your browser, the debugger should stop at the debugger statement as soon as you inject a message.

  • If you don't arrive at your statement, there must be an issue in the dashboard communication.
  • If you arrive at your statement, the led-node isn't handling the input message content correctly ...

Bart