mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(input): add overview examples for input (#5228)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {FormControl, Validators} from '@angular/forms';
|
||||
|
||||
const EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
|
||||
|
||||
@Component({
|
||||
selector: 'input-errors-example',
|
||||
templateUrl: 'input-errors-example.html',
|
||||
styleUrls: ['input-errors-example.css'],
|
||||
})
|
||||
export class InputErrorsExample {
|
||||
|
||||
emailFormControl = new FormControl('', [
|
||||
Validators.required,
|
||||
Validators.pattern(EMAIL_REGEX)]);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user