我有一个关于角度验证的问题。
我的观点:
我已经放入了jsfiddle
Console.WriteLine();
Console.WriteLine("Enter your letter grades when prompted.");
Console.WriteLine("=======================================");
for (int a = 1; a == standardNumber; a++)
{
int num = 1;
Console.WriteLine("Enter letter grade for honors class {0}:", num);
switch (num)
{
case 1:
string class1 = Console.ReadLine();
break;
case 2:
string class2 = Console.ReadLine();
break;
case 3:
string class3 = Console.ReadLine();
break;
case 4:
string class4 = Console.ReadLine();
break;
default:
break;
}
Console.WriteLine();
}
}
答案 0 :(得分:0)
我认为你不想用户"必需"文本域的属性和下面的属性可以使用
<div ng-app="appX">
<div ng-controller="validationCtrl">
<form name="xyzForm" novalidate>
<input
type="text"
name="name"
ng-model="xname"
ng-class="{'has-error': xyzForm.name.$invalid && !xyzForm.name.$pristine}"
/>
<input
type="number"
name="age"
ng-model="xage"
ng-class="{'has-error': xyzForm.age.$invalid && !xyzForm.age.$pristine && xyzForm.age.$dirty}"
/>
<div>
<button ng-click="submit()" ng-disabled="(xyzForm.$invalid || xyzForm.$pristine) || !xage || xname
==''">Submit</button>
<span>invalid : {{xyzForm.$invalid}}</span>
<span>pristine : {{xyzForm.$pristine}}</span>
</div>
</form>
</div>
</div>