Conversation
| return this.group.get(def.path)!.valueChanges.pipe( | ||
| const control = this.group.get(def.path)!; | ||
| return control.valueChanges.pipe( | ||
| debounceTime(0), |
There was a problem hiding this comment.
I had to use this to ensure group.valid is up to date at this point. For more info, you can check angular/angular#40649. Also let me know if you have a better solution than this.
| export type ParamDefType = 'boolean' | 'array' | 'number' | 'string' | 'object'; | ||
|
|
||
| export type QueryParamParams<QueryParams = any> = { | ||
| ignoreInvalidForm?: boolean; |
There was a problem hiding this comment.
Please, feel free to suggest another name if needed :)
|
|
||
| tick(); | ||
|
|
||
| assertRouterCall(spectator, { withMinlengthValidator: 'with1' }); |
There was a problem hiding this comment.
@NetanelBasal I'm stucked in this test. I was hoping the router to be called with
{
searchTerm: 'term',
withMinlengthValidator: 'with1',
}... but, as the filter excludes searchTerm as the group was invalid at that time, the buffer isn't being populated as expected. Would you mind to help me on how we can solve this problem?
|
@NetanelBasal please, note that this is still a draft. I want to get an initial feedback on names and how we can solve the problem I explained above. After that, I'll try to work on docs and in the final implementation. |
| const controls = this.defs.map((def) => { | ||
| return this.group.get(def.path)!.valueChanges.pipe( | ||
| const control = this.group.get(def.path)!; | ||
| return control.valueChanges.pipe( |
There was a problem hiding this comment.
Why we're checking the group here? I think the check should only be if the control is valid. If that's the case, we can update the address.
There was a problem hiding this comment.
Hmm, that's interesting... if we didn't check the group validity, how can we prevent a router sync if any control is invalid?
There was a problem hiding this comment.
The intention was not to sync the specific controls that are not valid. Why preventing other valid controls?
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
There's no option to ignore invalid form.
Issue Number: Closes #8.
What is the new behavior?
A new option to ignore invalid form.
Does this PR introduce a breaking change?
Other information