-
Notifications
You must be signed in to change notification settings - Fork 83
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 model if query parameter is removed #125
Comments
You can do that with <app-router>
<app-route path="/user/:userId/**" element="user-page" onUrlChange="updateModel"></app-route>
</app-router> |
Ah, thank you! I missed the link to the documentation from the GitHub page and was just working off readme.md |
Actually, I am seeing an issue where if the URL is updated to remove a hash path query parameter then the corresponding data binding is not updated by setting the property to undefined. Instead, it retains its previous value. e.g., going from: |
I see where the problem is but I'm not sure how to fix this one. Updating the model happens here https://github.com/erikringsmuth/app-router/blob/master/src/app-router.js#L266. The problem is |
I guess keep a map of current known parameters and if any disappear then delete them?
|
If only a query search parameter changes (either in the main URL or in the URL hash) if would be nice to have a mode which avoided recreating the models and instead just updated the data binding.
For example, going from:
http://server.com/path/path?server=blarg#route?param=foo
to:
http://server.com/path/path?server=blarg#route?param=bar
The text was updated successfully, but these errors were encountered: