Skip to content
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

Update the form when the queryParams are updated #32

Open
dc-p8 opened this issue Oct 3, 2023 · 2 comments
Open

Update the form when the queryParams are updated #32

dc-p8 opened this issue Oct 3, 2023 · 2 comments

Comments

@dc-p8
Copy link

dc-p8 commented Oct 3, 2023

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.

@stackblitz
Copy link

stackblitz bot commented Oct 3, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@NetanelBasal
Copy link
Member

@shaharkazaz can you take this discussion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants