diff --git a/packages/@ember/routing/router-service.ts b/packages/@ember/routing/router-service.ts index 8da73347904..139331df1d0 100644 --- a/packages/@ember/routing/router-service.ts +++ b/packages/@ember/routing/router-service.ts @@ -454,12 +454,12 @@ class RouterService extends Service.extend(Evented) { import Route from '@ember/routing'; import { service } from '@ember/service'; - export default class extends Route { + export default class ContactFormRoute extends Route { @service router; - callback = (transition) => { + callback = (transition) => { if (!transition.to.find(route => route.name === this.routeName)) { - alert("Please save or cancel your changes."); + alert('Please save or cancel your changes.'); transition.abort(); } }; @@ -470,6 +470,7 @@ class RouterService extends Service.extend(Evented) { deactivate() { this.router.off('routeWillChange', this.callback); + } } ```