This must be used in the class attribute and must be the only part used in
the attribute. It takes each property in the classInfo argument and adds
the property name to the element's classList if the property value is
truthy; if the property value is falsy, the property name is removed from
the element's class.
For example {foo: bar} applies the class foo if the value of bar is
truthy.
A directive that applies dynamic CSS classes.
This must be used in the
class
attribute and must be the only part used in the attribute. It takes each property in theclassInfo
argument and adds the property name to the element'sclassList
if the property value is truthy; if the property value is falsy, the property name is removed from the element'sclass
.For example
{foo: bar}
applies the classfoo
if the value ofbar
is truthy.