mercredi 2 août 2017

How to add click event to `tagName` in ember component?

I would like to add the click event to components tagname what is the correct way to do it?

here is my code : please see the comment for more details

import Ember from 'ember';

export default Ember.Component.extend({
    tagName: 'li', //my tag onlick how to call 'selectedCard'?
    firstBalanceType : '',
    firstBalanceAmount : '',
    lastBalanceType : '',
    lastBalanceAmount : '',
    actions : {
        selectCard : function(card) { //requrie to pass the card here
            //console.log('card selected' + card);
            this.sendAction('enableNext', card);
        }
    }
});

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire