5 lines
6.9 KiB
JSON
5 lines
6.9 KiB
JSON
{
|
|
"id": "api/forms/PatternValidator",
|
|
"title": "PatternValidator",
|
|
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/forms\", \"name\": \"@angular/forms\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/forms/PatternValidator\", \"name\": \"PatternValidator\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/forms\">@angular/forms</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/forms/src/directives/validators.ts?message=docs(forms)%3A%20describe%20your%20change...#L673-L741\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/forms/src/directives/validators.ts#L673-L741\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"patternvalidator\">PatternValidator<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms/PatternValidator#patternvalidator\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label directive\">directive</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>A directive that adds regex pattern validation to controls marked with the\n<code><a href=\"api/forms/PatternValidator\" class=\"code-anchor\">pattern</a></code> attribute. The regex must match the entire control value.\nThe directive is provided with the <code><a href=\"api/forms/NG_VALIDATORS\" class=\"code-anchor\">NG_VALIDATORS</a></code> multi-provider list.</p>\n\n \n </section>\n \n \n \n \n<section class=\"see-also\">\n <h2 id=\"see-also\">See also<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms/PatternValidator#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p><a href=\"guide/form-validation\">Form Validation</a></p>\n</li>\n </ul>\n</section>\n\n\n <h2 id=\"ngmodules\">NgModules<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms/PatternValidator#ngmodules\"><i class=\"material-icons\">link</i></a></h2>\n<ul class=\"ngmodule-list\">\n\n <li>\n <a href=\"api/forms/ReactiveFormsModule\">\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">ReactiveFormsModule</code-example>\n </a>\n </li>\n \n <li>\n <a href=\"api/forms/FormsModule\">\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">FormsModule</code-example>\n </a>\n </li>\n \n</ul>\n\n\n \n<section class=\"selector-list\">\n <h2 id=\"selectors\">Selectors<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms/PatternValidator#selectors\"><i class=\"material-icons\">link</i></a></h2>\n \n <ul>\n <li><code>[<a href=\"api/forms/PatternValidator\" class=\"code-anchor\">pattern</a>][<a href=\"api/forms/FormControlName\" class=\"code-anchor\">formControlName</a>]</code></li>\n \n <li><code>[<a href=\"api/forms/PatternValidator\" class=\"code-anchor\">pattern</a>][formControl]</code></li>\n \n <li><code>[<a href=\"api/forms/PatternValidator\" class=\"code-anchor\">pattern</a>][<a href=\"api/forms/NgModel\" class=\"code-anchor\">ngModel</a>]</code></li>\n \n </ul>\n \n</section>\n\n\n\n \n\n<section class=\"instance-properties\">\n <h2 id=\"properties\">Properties<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms/PatternValidator#properties\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th>Property</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"pattern\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\"><a href=\"api/forms/PatternValidator\" class=\"code-anchor\">pattern</a></span>: string | RegExp</code>\n </td>\n <td>\n \n <p>Tracks changes to the pattern bound to this directive.</p>\n\n \n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\n\n\n\n \n\n\n \n <section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms/PatternValidator#description\"><i class=\"material-icons\">link</i></a></h2>\n \n <h3 id=\"adding-a-pattern-validator\">Adding a pattern validator<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms/PatternValidator#adding-a-pattern-validator\"><i class=\"material-icons\">link</i></a></h3>\n<p>The following example shows how to add a pattern validator to an input attached to an\nngModel binding.</p>\n<code-example language=\"html\">\n<input name=\"firstName\" <a href=\"api/forms/NgModel\" class=\"code-anchor\">ngModel</a> <a href=\"api/forms/PatternValidator\" class=\"code-anchor\">pattern</a>=\"[a-zA-Z ]*\">\n</code-example>\n\n </section>\n \n\n \n\n \n\n \n\n \n \n \n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/core/OnChanges\n - api/forms\n - api/forms/FormsModule\n - api/forms/ReactiveFormsModule\n - api/forms/Validator\n - api/forms/Validators\n - guide/upgrade\n-->\n<!-- links from this doc:\n - /api\n - api/core/Input\n - api/forms\n - api/forms/FormControlName\n - api/forms/FormsModule\n - api/forms/NG_VALIDATORS\n - api/forms/NgModel\n - api/forms/PatternValidator#adding-a-pattern-validator\n - api/forms/PatternValidator#description\n - api/forms/PatternValidator#ngmodules\n - api/forms/PatternValidator#patternvalidator\n - api/forms/PatternValidator#properties\n - api/forms/PatternValidator#see-also\n - api/forms/PatternValidator#selectors\n - api/forms/ReactiveFormsModule\n - guide/form-validation\n - https://github.com/angular/angular/edit/master/packages/forms/src/directives/validators.ts?message=docs(forms)%3A%20describe%20your%20change...#L673-L741\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/forms/src/directives/validators.ts#L673-L741\n-->"
|
|
} |