I have an HTML element within a repeater where I want to change the class based on four conditions. The condition is based on a attribute from JSON. The attribute is called type , and the css classes I am working with are red , blue ,and green .The conditions are:

If type = red then assign css class red If type = blue then assign css class blue If type = green then assign css class green If type is not defined or null then assign css class red

With my limited experience with AngularJS I know that I can set a conditional CSS using the ng-style attribute. How would I achieve this using Aurelia?

Sample HTML markup