Method for triggering an action on any controller from a component, such as with nested Ember components.
WARNING: You really shouldn't do this as it couples your component to your app, which kind of defeats the purpose of the component, right?
GlobalAction = Ember.Mixin.create
triggerGlobalAction: (action, controller="application", args...) ->
@triggerAction
action: action
target: @container.lookup('controller:' + controller)
actionContext: args
MyBadComponent = Ember.Component.extend(GlobalAction, {
click: (e) ->
e.preventDefault()
@triggerGlobalAction('openModal', 'application', 'modals/modal-name')
})