Menu

class

An HTML content command for setting the "class" attribute on an element.

The host element's "class" is set to whatever String this command's primary attribute resolves into. Note that this will overwrite any existing "class" value on the element.   

This command has a priority of 15.

Examples

This content command can come useful in looped content to have the content produced in different loop rounds have visual differences. If, for example, there's a list of tasks, the tasks' list items could receive a different class based on their completion status.

<ul>
  <li dyn-repeat="tasks" dyn-repeat-var="task" dyn-class="task.isComplete ? 'completeTask' : 'incompleteTask'" dyn-content="task.subject">task</li>
</ul>   

Comments

0 comments