I am in the process of implementing Form Validation using AngularJS, and I have come across a scenario involving ng-class that is confusing me. Could someone please explain why they are utilizing ng-class in this manner? The presence of a map and an array right after has left me puzzled on how to activate the 'has-error' class:
<div ng-if="conditionItem.field.id"
ng-class="{true: 'has-error'}[field.hasError]"
dynamic
input-router
source="conditionItem.field"
required ng-model="conditionItem.situation[$index]">
</div>