I am currently attempting to assign a class to an item in a paginated list by simulating a click on the element within the directive's link property:
link : function (scope, element, attrs) {
element.bind('click', function () {
element.addClass("blue");
});
}
Although this method works fine, I encounter an issue when navigating from one page to another. The classes that were applied to items on the first page are lost when moving to the second page. How can I ensure that all items retain the previously applied class?
Thank you.
Feel free to check out this Plunker for better understanding