I wrote this little app in JavaScript with the intent of porting over to elm. The basic function is done in Elm but stuck on one feature.
DEMO: https://fedreg.github.io/Counterpoint.js/ On the demo, if you click on "Add Instrument", a new input field is added to the dom which acts as an exact duplicate of the original input; both calling the same function when the Play button is clicked Here is how I do this in JS: https://github.com/Fedreg/Counterpoint.js/blob/master/app.js#L175-L198 So in JS, I just build up the calling function as such: If I have one input field, with an id="input1", the button onclick=play(input1). If I have two input fields, the button onclick=play(input1); play(input2) three fields: onclick=play(input1); play(input2); play(input3); .....and on and on depending on number of added instruments. Therefore, onclick the play function is called with the values in each of the input fields. Can't figure out how to do this in ELm. The value inside of my input field is part of my model. Can I somehow dynamically update my Model to add new "NotesToSend" as new input fields are added?? Should I just generate these inputs in JS and send the data into Elm for processing?? . type alias Model = { initialNotes : String , notesToSend : List Note , index : Int } Any help or pointer to a similar code example are greatly appreciated. Please let me know if additional clarification is needed. Thanks! -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
