We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f9ff21 commit 0474c8aCopy full SHA for 0474c8a
src/directive.js
@@ -119,6 +119,7 @@
119
require: 'ngModel',
120
scope: {
121
model: '=ngModel',
122
+ initialValidity: '=initialValidity',
123
validCallback: '&',
124
invalidCallback: '&'
125
},
@@ -153,9 +154,17 @@
153
154
element.after('<span></span>');
155
156
/**
- * Set Validity to false when Initial
157
+ * Set initial validity to false if no boolean value is transmitted
158
*/
- ctrl.$setValidity(ctrl.$name, false);
159
+ if (typeof scope.initialValidity !== 'boolean') {
160
+ scope.initialValidity = false;
161
+ }
162
+
163
+ /**
164
+ * Set custom initial validity
165
+ * Usage: <input initial-validity="true" ... >
166
+ */
167
+ ctrl.$setValidity(ctrl.$name, scope.initialValidity);
168
169
170
* Reset the validation for specific form
0 commit comments