#class Directive

There's a directive that makes it much easier to add and remove classes dynamically. The #class directive allows you to define class names to add or remove if the associated value is truthy or falsy. It accepts an object where the property names are the class names and the property values are the conditions.