angular.widget.@ng:required
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>
Parameters
CSS
ng-validation-error
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/);
});