clbond / ng2-redux-form

Connect Angular 2 forms to Redux stores
17 stars 7 forks source link

How to control field values from component? #8

Closed Polvista closed 7 years ago

Polvista commented 7 years ago

I have not found that in examples, how could one set a field value?

For example initial value or clear value after some async request.

clbond commented 7 years ago

You would change the value of a control by dispatching an action and updating your Redux state. You would never directly update a field's value; you update your Redux state and that change will automatically make its way to the field.

Polvista commented 7 years ago

Ok, I'll try) Thanks!