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

runGuardsAndResolvers: 'paramsOrQueryParamsChange': resolve on query param change works but data does not seems to be passed to subscribed Observable. #15290

Closed
basilikum opened this issue Mar 19, 2017 · 9 comments · Fixed by #15387

Comments

@basilikum
Copy link

I'm submitting a ...

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
When using runGuardsAndResolvers: 'paramsOrQueryParamsChange' to make sure that a resolver is run whenever a query parameter changes, the resolver does runs, but the fetched data is not passed onto the subscription to the route.data Observable within the component.

Expected behavior
If I subscribe to route.data within the component, I would expect to get updates whenever new data is fetched, but I only get the initial data, no updates.

Please tell us about your environment:
Ubuntu 16.04

  • Angular version: 2.0.X
    Angular 4.0.0-rc.5

  • Browser:
    Chrome 54

@Toxicable
Copy link

Can you reproduce in a plunkr please

@basilikum
Copy link
Author

@Toxicable I'm sorry I'm afraid that I am not really familiar with plunker and fiddling around with it to create an angular4.0.0-rc.5 setup will simply take too much time, that I don't have right now. But I created a sample app with angular-cli and moved it to my github: https://github.com/basilikum/bug15290_ng4

It is very straight forward: the link "change query param" changes the query param i, to the current value of item (which is the big letter number on screen). Then the resolver kicks in and resolves item to a new random number. But as you can see, the number is never updated, despite the fact, the the resolver actually runs.

@Toxicable
Copy link

@basilikum here's a template plunkr for v4
http://plnkr.co/edit/lU32vBJY9KYXZUTW7GQQ?p=preview

@basilikum
Copy link
Author

@Toxicable Sorry I could not get it to run within plunker. Probably just a small mistake but I have to look into it but currently not time. I can try to get the plunker demo to run within the next 2 days or so but probably not before that. Sorry again. Does the github repo not help?

@Toxicable
Copy link

I didn't try your github repo but it works fine in this plunkr
http://plnkr.co/edit/iGxAp2jfTCjUNGs5vQQ4?p=preview
So looks like something wrong with the way you're testing it possibly, or maybe your setup

@basilikum
Copy link
Author

@Toxicable Hmm...but your plunker does not even change the query params in the url? Still does not seem to work for me in this example: http://plnkr.co/edit/UC39EjWv261lnbGMxVqT?p=preview
If you click on the link, it changes the query param and should therefore update with a new random number, which it does not.
You can also see that in the console. The "resolve" log will be executed, but not the "in subscribe" log.

@Toxicable
Copy link

@basilikum Right, sorry I see what you're saying. Okay well i'm not sure what's up in this case then

@basilikum
Copy link
Author

@Toxicable Ok, thank you anyway. Especially for the help with plunker.

DzmitryShylovich added a commit to DzmitryShylovich/angular that referenced this issue Mar 22, 2017
DzmitryShylovich added a commit to DzmitryShylovich/angular that referenced this issue Mar 22, 2017
DzmitryShylovich added a commit to DzmitryShylovich/angular that referenced this issue Mar 23, 2017
DzmitryShylovich added a commit to DzmitryShylovich/angular that referenced this issue Mar 23, 2017
DzmitryShylovich added a commit to DzmitryShylovich/angular that referenced this issue Mar 23, 2017
asnowwolf pushed a commit to asnowwolf/angular that referenced this issue Aug 11, 2017
juleskremer pushed a commit to juleskremer/angular that referenced this issue Aug 28, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants