How can I conditionally require form inputs with AngularJS?

后端 未结 5 963
一生所求
一生所求 2020-11-27 10:08

Suppose we\'re building an address book application (contrived example) with AngularJS.

We have a form for contacts that has inputs for email and phone number, and w

5条回答
  •  一生所求
    2020-11-27 10:46

    Simple you can use angular validation like :

     
    
        
    

    You can now fill the value in only one text field. Either you can fill name or lastname. In this way you can use conditional required fill in AngularJs.

提交回复
热议问题