Search code examples
angularjstabsmaterialize

Detect Materializecss tab change


I am using Angular-materialize tabs and need to detect when a user changes tabs so that I can call a separate function on tab change (some data on each tab pane is not automatically loaded) Is this possible without using ng-click?


Solution

  • Materialize does not provide a way to bind a function to tab change event.
    Therefore, you have to use ng-click in <a> tag or bind a event handler:

    $('ul.tabs').on('click', 'a', function(e) {
        //Your code
    });