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

Cards attributes #76

Closed
deOutremer opened this issue Apr 16, 2015 · 1 comment
Closed

Cards attributes #76

deOutremer opened this issue Apr 16, 2015 · 1 comment

Comments

@deOutremer
Copy link

Hi,
I am a novice developer, just starting out with ember, and I have question about you implementation of Cards:
Is there a property that can allow using cards as buttons? I want to be able to select a card in my app, and I'm not sure if this is a trivial thing to do or something that needs to be implemented and hasn't yet.

@miguelcobain
Copy link
Owner

You would need to reopen the paper-card component and implement your click behavior there.
Example:

// app/components/paper-card.js
import PaperCardComponent from 'ember-paper/components/paper-card';

export default PaperCardComponent.extend({
  click: function() {
    //this makes this component send out an action to our app if it is clicked
    this.sendAction();
  }
});

Then in your template:

{{paper-card action="cardClicked"}}

Then the normal ember action process takes place. Learn more about actions: http://guides.emberjs.com/v1.10.0/templates/actions/

I didn't test the code, but I'm pretty sure it works. Let me know if you have any problems. Thanks.

Does this follow the material design spec? If it does, it would make sense to add this to ember-paper.

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

2 participants