Improve this Doc View Source ngRequired
- directive in module ng
The directive sets the
required attribute on the element if the Angular expression inside
ngRequired evaluates to true. A special directive for setting
required is necessary because we cannot use interpolation inside
required. See the interpolation guide for more info.
The validator will set the
required error key to true if the
required attribute is set and calling
NgModelController.$isEmpty with the
true. For example, the
$isEmpty() implementation for
input[text] checks the length of the
$viewValue. When developing custom controls,
$isEmpty() can be overwritten to account for a $viewValue that is not string-based.
- This directive executes at priority level 0.
- as attribute:
<ANY> ... </ANY>
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.