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

Returning router.load ends up not loading the route #39

Open
CollinHerber opened this issue Mar 9, 2022 · 0 comments
Open

Returning router.load ends up not loading the route #39

CollinHerber opened this issue Mar 9, 2022 · 0 comments

Comments

@CollinHerber
Copy link

CollinHerber commented Mar 9, 2022

🐛 Bug Report

Returning the router.load function ends up not loading the route.

return this.router.load('someRoute'); //No worky

this.router.load('someRoute'); //Works fine
return;

The full controller

import { inject } from 'aurelia';
import { IRouter } from 'aurelia-direct-router';

@inject(IRouter)
public class SomeClass {
         constructor(private router: IRouter) {}

         attached() {
              return this.router.load('someRoute'); //Does not load anything
              //comment out one or the other
              this.router.load('someRoute'); //Loads the route
              return;
         }
}

🤔 Expected Behavior

I would expect you to be able to have return on the same line.

😯 Current Behavior

return this.router.load('someRoute'); //Does not load anything

this.router.load('someRoute'); //Loads the route
return;

💁 Possible Solution

return this.router.load('someRoute'); //Should Work
return await this.router.load('someRoute'); //Should Work

🌍 Your Environment

Software Version(s)
Aurelia latest v2
Language English
Browser Chrome
Bundler Webpack
Operating System W10
NPM/Node/Yarn Npm
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

1 participant