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

on-click with parameter #3

Open
jamiechong opened this issue Apr 2, 2015 · 6 comments
Open

on-click with parameter #3

jamiechong opened this issue Apr 2, 2015 · 6 comments

Comments

@jamiechong
Copy link

Is there anyway to pass a parameter to the on-click attribute? Similar to the {{action}} helper?

I'm trying to use em-button instead of this:
<button {{action 'auth' 'facebook'}}>Login With Facebook</button>

@emablekos
Copy link

Bump

@asaf
Copy link
Contributor

asaf commented May 13, 2015

@jamiechong @emablekos Tell me if this is sufficient for you:

Instead of limitation of one param, you can now do this:

{{em-button prop=x prop1=y on-click='submit'}}

Then in controller:

actions {
 submit: function(setPromise, button) {
   button.get('prop') // retrieve value of x
 }
}

@jamiechong
Copy link
Author

That looks like it should work!

@asaf
Copy link
Contributor

asaf commented May 14, 2015

ok, I pushed it.

@jamiechong
Copy link
Author

Has the npm package been updated? I'm using ember-cli

@yangmingshan
Copy link

@asaf The npm package is not the latest, can you update it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants