Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal: do not use 'trigger' together with 'sendAction' #36

Closed
andrewfan opened this issue Aug 19, 2014 · 3 comments
Closed

Modal: do not use 'trigger' together with 'sendAction' #36

andrewfan opened this issue Aug 19, 2014 · 3 comments
Assignees
Labels

Comments

@andrewfan
Copy link

Looks like now we can pass hide option in modal component.
But component's open, close methods https://github.com/indexiatech/ember-components/blob/master/lib/modal/modal.coffee#L129 use trigger and sendAction together that will cause an error. I explain why:
trigger wants a reference to real function inside hide param.
sendAction wants a string with the name of method that we will be propagated.

I recommend to remove trigger call because using sendAction is the best practice http://emberjs.com/guides/components/sending-actions-from-components-to-your-application/

@hussasad
Copy link

I am facing the same issue. I tried handling the 'show' action, which is sent from inside the modal component's open method like this

{{#em-modal configName="bs" open-if=openModal show="showPopup"}}

but i get an error since the open method is calling a trigger with the same name (this.trigger('show') which is followed by this.sendAction('show',this) )

is there a solution for this?

@asaf
Copy link
Contributor

asaf commented Dec 14, 2014

Agreed.

@asaf
Copy link
Contributor

asaf commented Dec 16, 2014

I duplicated this issue in the modal addon: indexiatech/ember-idx-modal#3

closing here.

@asaf asaf closed this as completed Dec 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants