angular.widget.@ng:required

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

The ng:required attribute widget validates that the user input is present. It is a special case of the ng:validate attribute widget.

Usage

In HTML Template Binding

<INPUT ng:required>
   ...
</INPUT>

Example

This example shows how the input element becomes red when it contains invalid input. Correct the input to make the error disappear.

I cannot be blank: <input type="text" name="value" ng:required><br/> it('should check ng:required', function(){ expect(element('.doc-example-live :input').attr('className')).toMatch(/ng-validation-error/); input('value').enter('123'); expect(element('.doc-example-live :input').attr('className')).not().toMatch(/ng-validation-error/); });