Skip to content

Update the form when the queryParams are updated #32

@dc-p8

Description

@dc-p8

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

When updating the queryParams of a component via this.router.navigate([], { queryParams: { search: 'b' } });, the formControl search is not updated.

Expected behavior

The formControl search should be updated with the value b

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/stackblitz-starters-3f5dsm?file=src%2Fapp%2Fapp.component.ts

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

When navigating through the app, inputs should match the queryParams even if the component is reused.
The binding should be "bi-directional".
The only way to achieve this is to completely destroy the component or manually listen to queryParams and update the form.

I can eventually do the PR, do not hesitate if you have any ideas on how to implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions