Skip to content

Commit 8736637

Browse files
committed
remove {{action}} helper
1 parent 3b875ed commit 8736637

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

test-app/lib/ember-blog/addon/controllers/post.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,22 @@ export default class extends Controller {
3535
set(this, 'transitionTo', true);
3636
});
3737
}
38+
39+
@action goToChineseVersion() {
40+
this.transitionTo({ queryParams: { lang: 'Chinese' } });
41+
}
42+
43+
@action transitionToHome() {
44+
this.transitionToExternal('home').then(() => {
45+
var postController = this.controllerFor(this.routeName);
46+
postController.set('transitionedToExternal', true);
47+
});
48+
}
49+
50+
@action replaceWithHome() {
51+
this.replaceWithExternal('home').then(() => {
52+
var postController = this.controllerFor(this.routeName);
53+
postController.set('replacedWithExternal', true);
54+
});
55+
}
3856
}

test-app/lib/ember-blog/addon/routes/post.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,4 @@ export default class extends Route {
1111
title: `Post ${params.id}`,
1212
};
1313
}
14-
15-
@action goToChineseVersion() {
16-
this.transitionTo({ queryParams: { lang: 'Chinese' } });
17-
}
18-
19-
@action transitionToHome() {
20-
this.transitionToExternal('home').then(() => {
21-
var postController = this.controllerFor(this.routeName);
22-
postController.set('transitionedToExternal', true);
23-
});
24-
}
25-
26-
@action replaceWithHome() {
27-
this.replaceWithExternal('home').then(() => {
28-
var postController = this.controllerFor(this.routeName);
29-
postController.set('replacedWithExternal', true);
30-
});
31-
}
3214
}

test-app/lib/ember-blog/addon/templates/post.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
{{!-- template-lint-disable no-action --}}
2020
<LinkTo @query={{hash lang="Japanese"}} class="routable-post-jp-link">Go to Japanese version</LinkTo>
21-
<button {{action "goToChineseVersion"}} class="routable-post-ch-link" type="button">Go to Chinese version</button>
22-
<button {{action "transitionToHome"}} class="routable-post-transition-to-home-button {{if this.transitionedToExternal "transitioned-to-external"}}" type="button">
21+
<button {{this.goToChineseVersion}} class="routable-post-ch-link" type="button">Go to Chinese version</button>
22+
<button {{this.transitionToHome}} class="routable-post-transition-to-home-button {{if this.transitionedToExternal "transitioned-to-external"}}" type="button">
2323
Go home programmatically
2424
</button>
2525

26-
<button {{action "replaceWithHome"}} class="routable-post-replace-with-home-button {{if this.replacedWithExternal "replaced-with-external"}}" type="button">
26+
<button {{this.replaceWithHome}} class="routable-post-replace-with-home-button {{if this.replacedWithExternal "replaced-with-external"}}" type="button">
2727
Also goes home programmatically
2828
</button>
2929

0 commit comments

Comments
 (0)