I am attempting to apply multiple styles to an accordion group using the ng-style
directive since ng-class
is not compatible with accordions.
Here is my current implementation:
ng-style="{ border: ivrMessageForm.ivr_messagetitle.$error.required && !isFormValid ? '2px solid' : 'none' }"
This is working as expected, but I also need to include a border-color
.
I attempted the following:
ng-style="{ border: ivrMessageForm.ivr_messagetitle.$error.required && !isFormValid ? '2px solid' : 'none', border-color: ivrMessageForm.ivr_messagetitle.$error.required && !isFormValid ? 'red' : 'none'}"
However, this results in a parse error.
I also tried the following approach with the same parse error:
ng-style="ivrMessageForm.ivr_messagetitle.$error.required ? {border:'3px solid', border-color: 'red'} : {border:'none', border-color: 'none'}"
Could anyone provide guidance on how to apply multiple style attributes with various conditions using ng-style?