I'm so close! I have it working but I have one odd thing I haven't been able to figure out and I've setup a demo (3 nodes) of the flow.
At NR startup, the dashboard looks like this:
The inject node (simulating the response from the file-lister node)just builds an array of two songs:
It feeds the template node that builds the list and now the dashboard looks like this:
selecting a song and you see the feedback on the screen
and when you press the button, the debug shows the returned data:
BUT now the dashboard looks like this:
Anyone have any ideas?
Here is the flow:
[{"id":"eddb3139.c693c","type":"ui_template","z":"e42d06a5.df9ff","group":"fb192efb.ec12e","name":"Display Song List","order":1,"width":"12","height":"6","format":"<script>\n \nthis.scope.action = function(opt) {\n var playSong = opt || \"no data passed to function\";\n// console.warn(playSong)\n return playSong; } \n</script>\n\n\n<div style=\"max-width:400px;\">\n <ul>\n <li ng-repeat=\"song in msg.payload track by $index\" style=\"list-style-type: none;\">\n <label>\n <input type=\"radio\" ng-model=\"$parent.song\" name=\"data\" value=\"{{song}}\" required />{{song}}\n </label>\n </li>\n </ul>\n <p>data entered: {{song}}</p>\n\n <md-button ng-click=\"send({payload:action(song)})\">\n Click to send data to backend\n </md-button>\n\n</div>\n\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":810,"y":260,"wires":[["683393b5.ea38d4"]]},{"id":"683393b5.ea38d4","type":"debug","z":"e42d06a5.df9ff","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":810,"y":360,"wires":[]},{"id":"fe643496.658588","type":"inject","z":"e42d06a5.df9ff","name":"","topic":"","payload":"[\"song1.mp3\",\"song2.mp3\"]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":810,"y":160,"wires":[["eddb3139.c693c"]]},{"id":"fb192efb.ec12e","type":"ui_group","z":"","name":"Song List","tab":"4f46b96e.86aa9","order":1,"disp":true,"width":"12","collapse":false},{"id":"4f46b96e.86aa9","type":"ui_tab","z":"","name":"Demo","icon":"dashboard","order":7}]