Created
August 22, 2014 11:06
-
-
Save gunn/3bf7abd03e52dd6088b6 to your computer and use it in GitHub Desktop.
Component action forwarding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.ApplicationRoute = Em.Route.extend({ | |
actions: { | |
open: function(tweet) { | |
var handle, url; | |
handle = tweet.account.screen_name; | |
url = "https://twitter.com/" + handle + "/status/" + tweet.tweet_id; | |
return window.open(url, '_blank'); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.TweetPanelComponent = Ember.Component.extend({ | |
actions: { | |
click: function(tweet) { | |
return this.sendAction("click", tweet); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment