Angular directives to manage selection state and applying a class to selected elements.