How to set Twitter Bootstrap class=error based on AngularJS input class=ng-invalid?

后端 未结 2 2131
孤街浪徒
孤街浪徒 2021-02-18 21:32

I have a problem where my CSS is not taking effect (in Chrome), and I think there is some conflict with Twitter Bootstrap.

input.ng-invalid {
    border-color: r         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-02-18 22:24

    You can easily do it with ng-class directive:

    http://plnkr.co/edit/RihsxA?p=preview

    EDIT

    Example with bootstrap 3.3.5 and angular 1.4.2:

    http://plnkr.co/edit/5JNCrY8yQmcnA9ysC7Vc?p=preview

提交回复
热议问题