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

navigateToRoute can't be awaited in activate method #620

Open
tomschluter opened this issue Sep 28, 2018 · 1 comment
Open

navigateToRoute can't be awaited in activate method #620

tomschluter opened this issue Sep 28, 2018 · 1 comment
Assignees

Comments

@tomschluter
Copy link

tomschluter commented Sep 28, 2018

I'm submitting a bug report

  • Library Version:
    major.minor.patch-pre

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    8.11.3

  • NPM Version:
    6.3.0

  • JSPM OR Webpack AND Version
    webpack 4.1.1

  • Browser:
    Chrome 69 | Firefox 61

  • Language:
    TypeScript 2.9.2 - 3.0.3

Current behavior:
Even though navigateToRoute returns a promise, I can't seem to await it in the activate method. I can await it in any other function and it works perfectly, but when awaiting navigateToRoute in the activate method it hangs.

Expected/desired behavior:
Our TSLint expects all promises to be handled accordingly, so I figured I should be able to await it, like I do in other functions.

I have recreated the bug in a small project:
https://github.com/tomschluter/await-navigate-to-route

async activate() { await this.router.navigateToRoute('Contact'); }

The above is pretty much what causes the application to hang.

  • What is the motivation / use case for changing the behavior?
    Unless it is intended, it currently isn't working how it should be.
@davismj davismj self-assigned this Oct 12, 2018
@bigopon
Copy link
Member

bigopon commented Apr 17, 2019

I think this may not be a good feature, since it could lead to unresolved promise.
cc @davismj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants