1

This is very straightforward but I am not able to change the class.

I am basically verifying if the date is in correct format (DD-MMM-YYYY hh:mm:ss).

<input type="text" style="width : 80%" ng-model="startTime" ng-class="{invalid: !isValid ,valid: isValid}" />

where isValid is a scope variable which evaluates to true and false. The css class is not applied.

Here is the plnkr.

1 Answer 1

5

It is working. Inspect the element. Your bootstrap classes are overwriting it. Try this:

 .invalid {
    background-color: #FA787E !important;
  }

 .valid {
    background-color: #78FA89 !important;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Yes. Just figured that out . The !important was important. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.