I am experiencing an issue with my AngularJS script.
I have created a website for my personal network where I can control bulbs.
I access the site on both my computer and mobile device.
When I turn on a bulb on my mobile phone, the light goes off. I can see this change reflected on both my mobile phone and computer thanks to AngularJS.
However, when I turn on a bulb on my computer, the light goes on but I only see the result on my computer - nothing happens on my mobile phone. I have to reset the switch to its initial value in order to see all changes.
I'm unsure of the cause of this problem.
After updating the bulb state, I use $rootScope.$apply();
The code snippet used to set the state is as follows:
$rootScope[ 'ng'+receive.data.kLeseAdresse ] = receive.data.cStatus;
$rootScope.$apply();
Thank you for any assistance provided.