Smahane Smahane - 12 days ago 7
CSS Question

How to edit the css style of validation ng-class error

My question is very simple:

How can I edit the css style of the

ng-class
validation error 'error' of bootstrap v3?

Here is my code:

ng-class="(form.datos.$invalid) && ( form.datos.$touched || submitted) ? 'error': '' "


The error style here is a background red which I didn't like I want to change it to another color.

Answer

You should overrite the css but if you want to do it with angular you could use ng-style directive, and it would look like

ng-style="(form.datos.$invalid) && ( form.datos.$touched || submitted) && {'background-color':'#00F'}"