Angular is automatically adding 'ng-invalid' class on 'required' fields

后端 未结 5 1159
暖寄归人
暖寄归人 2020-12-24 05:41

I am building an angular app for which I have some forms set up. I have some fields that are required to be filled before submission. Therefore I have added \'required\' on

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-24 06:28

    the accepted answer is correct.. for mobile you can also use this (ng-touched rather ng-dirty)

    input.ng-invalid.ng-touched{
      border-bottom: 1px solid #e74c3c !important; 
    }
    

提交回复
热议问题