ngneat / forms-manager

🦄 The Foundation for Proper Form Management in Angular
https://www.netbasal.com
MIT License
518 stars 29 forks source link

Add getInitialValue() function to get the initial form value already stored in forms-manager #15

Closed manudss closed 4 years ago

manudss commented 4 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Cannot get the initial value of form. This was in private.

Expected behavior

We would like to be able to obtain the initial value of the form. This value has been saved by the plug-in for the isDirty function. It is not possible to retrieve this value, as it is in private property. There is a method called setInitialValue(). It would be useful to have a method: getInitialValue().

/*

What is the motivation / use case for changing the behavior?

In our case, we would need to retrieve the initial value of the form, in order to make calculations afterwards to calculate the differences and track all the changes that have been made. And, like, we would use this plug-in that would store the initial state. It would be a shame to have to store this state somewhere else, when it's already stored in form-manager, and we could just retrieve it here.

Is it ok for you to make a pull request to add this feature to the plug-in?

NetanelBasal commented 4 years ago

Yes

marleypowell commented 4 years ago

Is there a way that I can use this feature or is there a new package version that will be released soon?