Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

Dynamic component and 2 way binding

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles