In my AngularJs project, I am using DTOptionsBuilder with ColVis plugin to show and hide columns in a datatable. I need to perform certain operations when the visibility of the columns changes. I came across an event called 'column-visibility.dt' which notifies when the visibility of columns is altered. I want to achieve something similar to the code snippet below in an Angular way, but I'm unsure how to proceed.
$('#example').dataTable();
$('#example').on( 'column-visibility.dt', function ( e, settings, column, state ) {
console.log(
'Column '+ column +' has changed to '+ (state ? 'visible' : 'hidden')
);
} );