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;
}
1
  • Yes. Just figured that out . The !important was important. Thanks
    – lostpacket
    Sep 26, 2013 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.