Tip
You have a button and when clicked, you want to go to a route and you cannot use {{link-to}} – what do you do? This was usually my solution:
1 |
<button {{action "goSomewhere"}}>test</button> |
Then I create an action:
1 2 3 |
goSomewhere(){ this.transitionToRoute('some-where'); } |
With the ember-transition-helper, you can skip the clutter in your controller and simply write:
1 |
<button onclick={{transition-to 'some-where'}}>test</button> |
Credits & Links
Thank you Petter Kjelkenes for ember-transition-helper @ https://github.com/peec/ember-transition-helper
Win 5 Free Books, Sublime Text License or Webstorm License
Check out this competition for your chance to win 5 Pragmatic Programmers books and other stuff.
Do You Have A Good Tip?
Let us know if you have a good ember tip.
If you are enjoying my daily tips please spread the word with this one-click tweet.
If you do NOT like the tips then please reply to this email and let me know how I can improve them.