bind-query-params icon indicating copy to clipboard operation
bind-query-params copied to clipboard

Update the form when the queryParams are updated

Open dc-p8 opened this issue 1 year ago • 2 comments

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.

dc-p8 avatar Oct 03 '23 17:10 dc-p8

@shaharkazaz can you take this discussion?

NetanelBasal avatar Oct 04 '23 06:10 NetanelBasal