I am trying to make a bit of a dynamic dashboard. So far everything is working just fine...
I pull some data from a sqlite database (device name, device IP), generate buttons through the UI-Template using ng-repeat. When someone clicks on one of the buttons, it sends the correct device name and device IP address.
The ONLY part I can't figure out is how to add an additional value when ng-mousedown and ng-mouseup.
Right now... the payload is:
msg.payload = null
msg.devicename = device name
msg.ipaddress = device ipaddress
I need to set msg.payload to string "start" on ng-mousedown, and "stop" on mouseup. Here is the code in my UI Template:
<md-list>
<md-list-item ng-repeat="payload in msg.payload">
<md-button class="md-ink-ripple" ng-mousedown="send(payload)" ng-mouseup="send(payload)">{{payload.devicename}}</md-button>
</md-list-item>
</md-list>
What do I need to add to this to set the msg.payload to start/stop on mousedown/mouseup without losing/overwriting my other data?
Thanks in advance!