samedi 5 mai 2018

Bootstrap's event handler not working in Emberjs component

In my component's didInsertElement() method I register event handler for Bootstraps's tab component:

didInsertElement() {
    this._super(...arguments);

    console.log('didInsertElement....');
    console.log(this.$("a[data-toggle='tab']"));

    this.$('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
        console.log('TAB SHOWN....');
        console.log(e);
    });
}

However, my handler is not executed. I copied the same handler code on console in browser and it works. This only seems to be in case of Bootsrap tab. Appearance of my console messages confirm that didInsertElement() is working fine.




Aucun commentaire:

Enregistrer un commentaire