knockout.js Equivalents of AngularJS bindings ngClass


Example

AngularJS code for dynamic classes:

<p ng-class="{ highlighted: scopeVariableX, 'has-error': scopeVariableY }">Text.</p>

KnockoutJS equivalent:

<p data-bind="css: { highlighted: scopeObservableX, 'has-error': scopeObservableY }">Text.</p>