Skip to content

Commit

Permalink
Update router.ts
Browse files Browse the repository at this point in the history
The code examples were using routeWillUpdate / routeDidUpdate rather than the correct method name (routeWillChange / routeDidChange). I have updated them to match to reduce confusion.
  • Loading branch information
scottyd980 authored Feb 2, 2019
1 parent b63bec6 commit 7b5ff52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@ember/-internals/routing/lib/services/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ if (EMBER_ROUTING_ROUTER_SERVICE) {
router: service('router'),
init() {
this._super(...arguments);
this.router.on('routeWillUpdate', (transition) => {
this.router.on('routeWillChange', (transition) => {
if (!transition.to.find(route => route.name === this.routeName)) {
alert("Please save or cancel your changes.");
transition.abort();
Expand Down Expand Up @@ -393,7 +393,7 @@ if (EMBER_ROUTING_ROUTER_SERVICE) {
router: service('router'),
init() {
this._super(...arguments);
this.router.on('routeDidUpdate', (transition) => {
this.router.on('routeDidChange', (transition) => {
ga.send('pageView', {
current: transition.to.name,
from: transition.from.name
Expand Down

0 comments on commit 7b5ff52

Please sign in to comment.