Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c8fd7fd

Browse files
ProLoserIgorMinar
authored andcommitted
docs(api): add ngRequired to input/select/textarea directives
Closes #1202
1 parent 168db33 commit c8fd7fd

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/ng/directive/input.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ var inputType = {
1515
*
1616
* @param {string} ngModel Assignable angular expression to data-bind to.
1717
* @param {string=} name Property name of the form under which the control is published.
18-
* @param {string=} required Sets `required` validation error key if the value is not entered.
18+
* @param {string=} required Adds `required` validation error key if the value is not entered.
19+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
20+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
21+
* `required` when you want to data-bind to the `required` attribute.
1922
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
2023
* minlength.
2124
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -93,6 +96,9 @@ var inputType = {
9396
* @param {string=} min Sets the `min` validation error key if the value entered is less then `min`.
9497
* @param {string=} max Sets the `max` validation error key if the value entered is greater then `min`.
9598
* @param {string=} required Sets `required` validation error key if the value is not entered.
99+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
100+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
101+
* `required` when you want to data-bind to the `required` attribute.
96102
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
97103
* minlength.
98104
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -159,6 +165,9 @@ var inputType = {
159165
* @param {string} ngModel Assignable angular expression to data-bind to.
160166
* @param {string=} name Property name of the form under which the control is published.
161167
* @param {string=} required Sets `required` validation error key if the value is not entered.
168+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
169+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
170+
* `required` when you want to data-bind to the `required` attribute.
162171
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
163172
* minlength.
164173
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -224,6 +233,9 @@ var inputType = {
224233
* @param {string} ngModel Assignable angular expression to data-bind to.
225234
* @param {string=} name Property name of the form under which the control is published.
226235
* @param {string=} required Sets `required` validation error key if the value is not entered.
236+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
237+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
238+
* `required` when you want to data-bind to the `required` attribute.
227239
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
228240
* minlength.
229241
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -653,6 +665,9 @@ function checkboxInputType(scope, element, attr, ctrl) {
653665
* @param {string} ngModel Assignable angular expression to data-bind to.
654666
* @param {string=} name Property name of the form under which the control is published.
655667
* @param {string=} required Sets `required` validation error key if the value is not entered.
668+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
669+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
670+
* `required` when you want to data-bind to the `required` attribute.
656671
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
657672
* minlength.
658673
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -677,6 +692,7 @@ function checkboxInputType(scope, element, attr, ctrl) {
677692
* @param {string} ngModel Assignable angular expression to data-bind to.
678693
* @param {string=} name Property name of the form under which the control is published.
679694
* @param {string=} required Sets `required` validation error key if the value is not entered.
695+
* @param {boolean=} ngRequired Sets `required` attribute if set to true
680696
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
681697
* minlength.
682698
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than

src/ng/directive/select.js

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
*
3030
* @param {string} name assignable expression to data-bind to.
3131
* @param {string=} required The control is considered valid only if value is entered.
32+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
33+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
34+
* `required` when you want to data-bind to the `required` attribute.
3235
* @param {comprehension_expression=} ngOptions in one of the following forms:
3336
*
3437
* * for array data sources:

0 commit comments

Comments
 (0)