-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add new type of ngrxUpdateOn #118
Comments
Can you please elaborate a bit more on what the exact issue is? I don't get what you mean by "sends whole not serialized object". There may also an alternative to what you suggest: ngrx-forms subscribes to the <input *ngIf="values"
#instance="ngbTypeahead"
type="text"
class="form-control"
ngrxUpdateOn="blur"
[id]="formId + '.' + controlName"
[resultFormatter]="resultFormatter"
[ngbTypeahead]="search.bind(this)"
[inputFormatter]="inputFormatter"
(input)="$event.stopPropagation()"
[ngrxFormControlState]="(parentFormControl$ | async)"
(selectItem)="selectItem($event)"
(blur)="updateValueOnBlur($event)"
(focus)="onFocus($event)"
(click)="onClick($event)"
/> |
I mean we do have these
|
Ah, I understand now. The typeahead control value accessor is setting the whole object as the value instead of just the key. In this case I have two other suggested workarounds for you while we are working on the PR. First of all, looking at the code from bootstrap I see that they have support for preventing the typeahead to report the value change. So could you please just try adding Secondly, this scenario calls for a value converter. To be honest I am not sure how it works properly without it. Looking at the code for the typeahead again the Usually with ngrx-forms there is no need for things like |
I have just released version 3.1.0 which contains the enhancement from your PR. |
I use this repo in quite big project. We also use ng-boostrap's typeahead. And here I've faced some issue. We update store in custom way by using typeahead's hooks.
Updating store by
ngrx-forms
creates an issue for us (sends whole not serialized object) but we still want to have some of your cool features like validation etc.Maybe we should add another
ngrxUpdateOn
type likenever
which actually doesn't send value to store but dispatchMarkAsDirty
action to run validation etc.What do you think about this idea?
EDIT. I've even created PR already, because it's quite necessary for us.
The text was updated successfully, but these errors were encountered: