Skip to content

Commit

Permalink
use constructor instead of init
Browse files Browse the repository at this point in the history
  • Loading branch information
xg-wang committed Sep 23, 2020
1 parent c6226d0 commit 038471d
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
@@ -1,4 +1,4 @@
import { getOwner } from '@ember/-internals/owner';
import { getOwner, Owner } from '@ember/-internals/owner';
import { Evented } from '@ember/-internals/runtime';
import { symbol } from '@ember/-internals/utils';
import { assert } from '@ember/debug';
Expand Down Expand Up @@ -76,10 +76,10 @@ export default class RouterService extends Service {
return (this[ROUTER] = router);
}

init() {
super.init(...arguments);
constructor(owner: Owner) {
super(owner);

const router = getOwner(this).lookup('router:main') as EmberRouter;
const router = owner.lookup('router:main') as EmberRouter;

router.on('routeWillChange', (transition: Transition) => {
if (DEBUG) {
Expand Down

0 comments on commit 038471d

Please sign in to comment.