@wonderful123 wrote:
I have a form that creates a dynamic list of component input elements. How do I create a binding outside of the components?
Here’s a twiddle that will show the problem: Twiddle
The code:
valueList: [1, 2, 3, 4]
{{#each valueList as |v|}} {{component 'x-thing' val=(mut v)}} Value outside: {{v}} {{/each}}
Component:
<button {{action (action (mut val) 10)}}> Change to 10 </button> Val in component: {{val}}
Posts: 4
Participants: 2