UI Template ng-click binding msg to ng-click to send

I am trying to bind an input msg to my Ui template so that I can send it via ng-click. So far it has eluded me. I have tried scope.$watch and can create the variable but ng-click is not sending it. Here is my flow:

[{"id":"b65ae12fe1bd23ef","type":"function","z":"c6c8b7c140027b58","name":"checkRadio2","func":"const radio = env.get(\"radio2\");\nconst radios = global.get('radios')\nconst is6700 = radios.filter(checkradio2).toString();\n\nfunction checkradio2(data) {\n  return data == radio\n}\n\nif (global.get('radio2_On') === false) {\n  return { payload: `${radio} Not Available`, radio: radio, style: 'rounded-off' }\n} \nif (global.get('radio2_On') === true) {\n  if (radios.length === 0 ){\n    return { payload: `${radio} Available`, radio: radio,style: 'rounded' }\n  }\n  if (is6700 != radio && (global.get('connected') != '-XX-')) {\n    return { payload: `${radio} Available`, radio: radio,style: 'rounded' }\n  }\n  if (is6700 === radio && (global.get('connected') === '-XX-')) {\n    return { payload: `Select ${radio}`, radio: radio, style: 'rounded-available' }\n  }\n  if (is6700 === radio && (global.get('connected') === '6400')) {\n    return { payload: `Select ${radio}`, radio: radio, style: 'rounded-available' }\n  }\n  if (is6700 === radio && (global.get('connected') === radio)) {\n    return { payload: `${radio} Connected`, radio: radio, style: 'rounded-on' }\n  }\n}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":300,"wires":[["2476ba3d7fac5f7d","353fd417455e6174","38532a90b75bd99c"]]},{"id":"2476ba3d7fac5f7d","type":"ui_template","z":"c6c8b7c140027b58","group":"b914eca7a788b208","name":"6600","order":4,"width":2,"height":1,"format":"\n<md-button class=\"vibrate filled touched smallfont {{msg.style}}\" title= \"Click to select radio\"\n    ng-click=\"send({payload=msg.RADIO})\">\n    {{msg.payload}} <br/>\n</md-button>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","className":"","x":1010,"y":300,"wires":[["3c39b7153a51f355","7c1f866cefe125b8"]]},{"id":"3c39b7153a51f355","type":"function","z":"c6c8b7c140027b58","name":"bindRadio2","func":"if (msg.payload === '6600 Selected'){\n    if (global.get('connected') === '6400') { // set value to other radio from nickname\n    node.send( [[],[{payload: false}]])\n    await new Promise(r => setTimeout(r, 2000));\n    return [[{ payload: '6600' }], []]\n    }\n    if (global.get('connected') === '-XX-') {\n        return  [[{payload: '6600'}],[]]\n    } else\n        return [[{ payload: '6600' }], []]\n} ","outputs":2,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":300,"wires":[["0ad9adc87cd8414c"],["a6815003999a3ef9"]]},{"id":"b914eca7a788b208","type":"ui_group","name":"Radios","tab":"d8a12855.a756b8","order":1,"disp":false,"width":"4","collapse":false,"className":""},{"id":"d8a12855.a756b8","type":"ui_tab","name":"Station","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Thank you in advance.

Typo in ng-click
ng-click="send({payload=msg.RADIO})"
should be
ng-click="send({payload:msg.RADIO})"

2 Likes

Thank you.

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