Skip to content

Commit

Permalink
[BUGFIX LTS] fix router test regression for all router service
Browse files Browse the repository at this point in the history
properties
  • Loading branch information
NullVoxPopuli committed Oct 22, 2021
1 parent 62976fe commit 739b62a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/@ember/-internals/routing/lib/services/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default class RouterService extends Service {
}
const owner = getOwner(this) as Owner;
router = owner.lookup('router:main') as EmberRouter;
router.setupRouter();
return (this[ROUTER] = router);
}

Expand Down Expand Up @@ -240,7 +241,6 @@ export default class RouterService extends Service {
@public
*/
urlFor(routeName: string, ...args: any[]) {
this._router.setupRouter();
return this._router.generate(routeName, ...args);
}

Expand Down Expand Up @@ -376,7 +376,6 @@ export default class RouterService extends Service {
`You must pass a url that begins with the application's rootURL "${this.rootURL}"`,
url.indexOf(this.rootURL) === 0
);
this._router.setupRouter();
let internalURL = cleanURL(url, this.rootURL);
return this._router._routerMicrolib.recognize(internalURL);
}
Expand All @@ -397,7 +396,6 @@ export default class RouterService extends Service {
`You must pass a url that begins with the application's rootURL "${this.rootURL}"`,
url.indexOf(this.rootURL) === 0
);
this._router.setupRouter();
let internalURL = cleanURL(url, this.rootURL);
return this._router._routerMicrolib.recognizeAndLoad(internalURL);
}
Expand Down Expand Up @@ -511,7 +509,9 @@ RouterService.reopen(Evented, {
@type String
@public
*/
currentRouteName: readOnly('_router.currentRouteName'),
get currentRouteName() {
return this._router.currentRouteName;
},

/**
Current URL for the application.
Expand Down

0 comments on commit 739b62a

Please sign in to comment.