I'd like to know if there's an angularjs best practice for binding kendo custom events.
I have a grid with a column menu that allows you to hide or show columns.
A kendo columnHide or columnShow event is fired whenever you check/uncheck to hide/show a column.
In my directive, I have the following code to capture that event. I'd like to know if this is the best way of binding these events and if there are any potential memory issues (e.g. is it necessary to unbind these events):
angular.module('sgComponents').directive('sgGrid', [
link: function (scope, elm, attrs, ctrls) {
kendoGrid = elm.data('kendoGrid'); // the grid
kendoGrid.bind('columnHide', function () {
console.log('HIDE COLUMN');
});
kendoGrid.bind('columnShow', function () {
console.log('SHOW COLUMN');
});
}
]);