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

Router data doesn't update with ** matching #12603

Closed
austinrmiller opened this issue Oct 28, 2016 · 1 comment
Closed

Router data doesn't update with ** matching #12603

austinrmiller opened this issue Oct 28, 2016 · 1 comment

Comments

@austinrmiller
Copy link
Contributor

I'm submitting a ... (check one with "x")

[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

I tried to set up a route with something like:
{ path: '**', component: Foobar, resolve: {'myData': MyResolver} },

To allow URLs like
/foo/bar/baz/path/to/file.txt

And it all works fine on the first load - the resolved data derived from the full path is available with:
route: ActivatedRoute;
route.data.forEach((data) => {
console.log(data['myData']);
});

But then if the path is changed, the resolver is not called to recalculate the data, and the forEach body is not called again.

Expected behavior

The body of the forEach would be called any time the url changes.

Minimal reproduction of the problem with instructions

https://plnkr.co/edit/qc0dWTNzQOxgUnwWhlr5

What is the motivation / use case for changing the behavior?

I want to support fetching of things based on arbitrary paths during routing.

Please tell us about your environment:

Plunker with Chrome linux

  • Angular version: 2.0.X

    2.0.2

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    all

  • Node (for AoT issues): node --version =

vsavkin added a commit to vsavkin/angular that referenced this issue Oct 28, 2016
vsavkin added a commit to vsavkin/angular that referenced this issue Oct 28, 2016
vsavkin added a commit to vsavkin/angular that referenced this issue Nov 3, 2016
@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 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant