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

[DOC] Add missing closing bracket in RouterService docs #20276

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/@ember/routing/router-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,12 @@ class RouterService<R extends Route> 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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it matches the output of ember g route contact-form.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please. I find the anonymous class thing quite annoying; these were just the result of copying/moving existing docs.

@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();
}
};
Expand All @@ -470,6 +470,7 @@ class RouterService<R extends Route> extends Service.extend(Evented) {

deactivate() {
this.router.off('routeWillChange', this.callback);
}
}
```

Expand Down