phpcn_u15822017-05-15 17:14:08
You'd better submit the sample code online and run it. No problem can be seen from the code you provide now
我想大声告诉你2017-05-15 17:14:08
You can set the corresponding style if the form verification succeeds or fails, http://blog.csdn.net/u0111270...
淡淡烟草味2017-05-15 17:14:08
In fact, you can put the input box in one <form></form>
里面,然后给 form 添加一个 name
属性:<form name="myForm"></form>
。输入框给一个 ng-model
,比如叫 size
By doing this, you can call myForm.size.$valid
来判断是否通过验证。类似的,你也可以从 myForm.size.$error
this Object in HTML in real time to get more detailed error information
Use this to dynamically add class
就好,用 ng-class