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

Commit b43768a

Browse files
committed
docs(guide/forms): make required ngModel optional in custom e-mail RegExp example
1 parent e479572 commit b43768a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/content/guide/forms.ngdoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,7 @@ Note that you can alternatively use `ng-pattern` to further restrict the validat
440440
var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@example\.com$/i;
441441

442442
return {
443-
require: 'ngModel',
444-
restrict: '',
443+
require: '?ngModel',
445444
link: function(scope, elm, attrs, ctrl) {
446445
// only apply the validator if ngModel is present and Angular has added the email validator
447446
if (ctrl && ctrl.$validators.email) {

0 commit comments

Comments
 (0)