<table class="html5">
<tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 required属于原生html中input标签的属性,只要出现required就意味着必填,required="sth",sth存不存在,或者内容是什么都无所谓; ng-required则可以动态调整是否必填 例如 我想要用户输入firstname和lastname 只有输入了firstname之后,才必须输入lastname ng-app> > > >Title> > ng-controller> > >first name:> ng-model required> > >second name:> ng-model ng-required> ng-showrequired">last name required> > ><> > var myApp = angular.module("myApp",[]); myApp.controller("ctrl",["$scope",function ($scope) { //add here }]); > > > 原文链接:https://www.f2er.com/note/421435.html