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

Synchronize router based on manual trigger #165

Open
dev054 opened this issue Aug 10, 2020 · 2 comments
Open

Synchronize router based on manual trigger #165

dev054 opened this issue Aug 10, 2020 · 2 comments
Labels
Type: Question If you have questions about using ngqp

Comments

@dev054
Copy link

dev054 commented Aug 10, 2020

Hello, thanks for this great library, it's awesome! I'm about to use it in a new project, however my requirement is to synchronize filters in a table based on submit button. Is there any way to accomplish this? I thought something like { updateOn: 'submit' } from FormBuilder, but I couldn't find anything similar on documentation. Thanks in advance.

@dev054 dev054 added the Type: Question If you have questions about using ngqp label Aug 10, 2020
@Airblader
Copy link
Collaborator

Thanks for opening this issue. I'm currently recovering from an illness and on vacation, so unfortunately I can't look into this in detail quite yet, but I will definitely do so once I am back!

In general this is something I've had in mind but so far explicitly excluded since most of the complexity of ngqp wouldn't be needed for this — setting and reading parameters once is pretty easy, problems like debounce and syncing don't really occur. That said I can see why it would be nice if ngqp supported that for convenience reasons. Also ngqp just evolved since this decision was made and there would be some benefits to supporting this now for sure.

I am, however, a bit unsure of the "submit trigger" idea since ngqp currently doesn't need to deal with surrounding forms or form submission at all. An API to disable automatic syncing and trigger it explicitly, however, might be fairly easy to introduce.

A possible workaround at the moment might be to provide a custom router adapter that proxies everything to only happen on a defined trigger (I'll get more info this when I'm back).

@Airblader
Copy link
Collaborator

Sorry for the late reply – my illness took longer than anticipated and this fell off my radar. I was just reminded of this in #180, and here's a prototype of the workaround I mentioned: https://stackblitz.com/edit/angular-ivy-hgjj6l?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question If you have questions about using ngqp
Projects
None yet
Development

No branches or pull requests

2 participants