How to add validation attributes in an angularjs directive

后端 未结 3 1411
天命终不由人
天命终不由人 2020-12-17 17:27

I am trying to write an angular directive that adds validation attributes to the tag, but it doesn\'t seem to be working. Here is my demo. You will notice that \"Is Valid\

3条回答
  •  我在风中等你
    2020-12-17 18:06

    I know this is quite an old question, but for what it's worth, the angular docs describe ng-required which takes a boolean value. This solved a similar problem I was having.

    http://docs.angularjs.org/api/ng/directive/input

提交回复
热议问题