File tree Expand file tree Collapse file tree 3 files changed +21
-21
lines changed
test-app/lib/ember-blog/addon Expand file tree Collapse file tree 3 files changed +21
-21
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments