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

Commit 55150a6

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

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/ng/directive/input.js

Lines changed: 17 additions & 1 deletion
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
@@ -85,6 +88,9 @@ var inputType = {
8588
* @param {string=} min Sets the `min` validation error key if the value entered is less then `min`.
8689
* @param {string=} max Sets the `max` validation error key if the value entered is greater then `min`.
8790
* @param {string=} required Sets `required` validation error key if the value is not entered.
91+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
92+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
93+
* `required` when you want to data-bind to the `required` attribute.
8894
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
8995
* minlength.
9096
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -151,6 +157,9 @@ var inputType = {
151157
* @param {string} ngModel Assignable angular expression to data-bind to.
152158
* @param {string=} name Property name of the form under which the control is published.
153159
* @param {string=} required Sets `required` validation error key if the value is not entered.
160+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
161+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
162+
* `required` when you want to data-bind to the `required` attribute.
154163
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
155164
* minlength.
156165
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -216,6 +225,9 @@ var inputType = {
216225
* @param {string} ngModel Assignable angular expression to data-bind to.
217226
* @param {string=} name Property name of the form under which the control is published.
218227
* @param {string=} required Sets `required` validation error key if the value is not entered.
228+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
229+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
230+
* `required` when you want to data-bind to the `required` attribute.
219231
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
220232
* minlength.
221233
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -638,6 +650,9 @@ function checkboxInputType(scope, element, attr, ctrl) {
638650
* @param {string} ngModel Assignable angular expression to data-bind to.
639651
* @param {string=} name Property name of the form under which the control is published.
640652
* @param {string=} required Sets `required` validation error key if the value is not entered.
653+
* @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
654+
* the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
655+
* `required` when you want to data-bind to the `required` attribute.
641656
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
642657
* minlength.
643658
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
@@ -662,6 +677,7 @@ function checkboxInputType(scope, element, attr, ctrl) {
662677
* @param {string} ngModel Assignable angular expression to data-bind to.
663678
* @param {string=} name Property name of the form under which the control is published.
664679
* @param {string=} required Sets `required` validation error key if the value is not entered.
680+
* @param {boolean=} ngRequired Sets `required` attribute if set to true
665681
* @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
666682
* minlength.
667683
* @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than

src/ng/directive/select.js

Lines changed: 3 additions & 0 deletions
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)