store icon indicating copy to clipboard operation
store copied to clipboard

Question | NgxFormPluginModules ui states

Open st-clair-clarke opened this issue 8 years ago • 6 comments

Could you please add that touched and untouched states to the Form plugin?

Also, an {option: {}} for us to add any other ui state necessary. For instance, I currently add a target UI state that identifies different instances of the same form. This target is an @Input() target property. I use this target to switch the instance of the form being currently used,

Given, the example at https://ngxs.gitbooks.io/ngxs/plugins/form.html, this will have to be done for each form. So, each form will be a 1:1 mapping to its own store. Is this correct?

Let me know what you think. If there is an easier way to do this from my end that would be appreciated.

Cheers

st-clair-clarke avatar Apr 04 '18 02:04 st-clair-clarke

@amcdnl we can probably add a userData property in the state and create a corresponding action.

tsawan avatar Apr 04 '18 04:04 tsawan

I'm open to suggestions!

amcdnl avatar Apr 04 '18 23:04 amcdnl

We have two sources of truth. I can enable/disable the whole form assigning mystate.myform.disabled When I need to enable/disable individual controls, I have to get FormGroup reference and work on it imperatively. While we have dirty/disabled for the group in model, all the individual contolls can be modified impertively using FormGroup instance

AlgoTrader avatar Apr 06 '18 12:04 AlgoTrader

@tsawan - Anymore thoughts?

amcdnl avatar May 08 '18 13:05 amcdnl

@amcdnl I think it will be complicated to support enable/disable for individual form fields through store. If you believe it adds a lot of value, then let's consider it.

tsawan avatar May 08 '18 18:05 tsawan

I feel like that is getting a bit too deep into what could be controlled through the form itself. I don't think that that is a state management concern.

By @markwhitfeld (in Slack DM)

arturovt avatar Oct 10 '19 15:10 arturovt