-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
emitInitialValueOnInit is missing #232
Comments
Woops looks like we've forgotten about that one :o If anyone is keen to look into it please let me know. |
@maxime1992 |
@ChrTall yes that was done on purpose. You can see the code here: ngx-sub-form/projects/ngx-sub-form/src/lib/deprecated/ngx-root-form.component.ts Lines 70 to 72 in 4ab93f6
The reason being, if nothing changes why would you save it again, maybe just discard the edit |
Hello 👋 we are actually facing the same problem. We need to be able to manually save the form even if the input data are equal to the form values and the form was not touched for API reasons. We also tried to use Any reason / fix for this ? |
We also run into the same issue and I understand that you would not want to save as the data has not been changed. However, is there a way to know nothing has changed in the form? So we could disable the save button or show a message to inform the user nothing has changed :)? |
There's not at the moment. I think that's a valid use case though and that there's no work around at the moment. So I'd be willing to accept a new class property exposing that state. Would you be willing to make a PR @svenank3r ? In case you are, here's some guidance after taking a quick look: It will be looking a lot like this code. It should be built in a way that the perf impact of comparing the input data with the current form value should only affect the forms that are using the new property. This shouldn't be a big deal as observables are lazy by nature (and the new property should be an observable). |
@maxime1992 I will look into and see if I can come up with a fix |
I don't know if this is still of any use to you, but I do understand why the The combination of the outputFilterPredicate and the dirty check can enable you still make changes after the form has been tocuhed. Always being able to save (even when the form has not been touched) is not possible. |
I also would need the same: the ability to manually save even if the form value was not changed. On a side-note: is it possible to somehow trick ngx-sub-form into thinking that the initial value is empty? Some combination of form.formGroup.patchValue() and/or input$.next()? I didn't manage to accomplish that... |
Hi.
Thank you for the great library.
I'm updating to the new released version and I saw that the options
emitInitialValueOnInit
is missing. Can you please return back this feature.I want the emit my re-mapped value right away.
The text was updated successfully, but these errors were encountered: