5 lines
31 KiB
JSON
5 lines
31 KiB
JSON
|
{
|
||
|
"id": "api/forms",
|
||
|
"title": "@angular/forms",
|
||
|
"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 ]\n }\n </script>\n <a href=\"/api\">API</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/forms/PACKAGE.md?message=docs(...)%3A%20describe%20your%20change...\" 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/PACKAGE.md\" 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=\"angularforms\">@angular/forms<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms#angularforms\"><i class=\"material-icons\">link</i></a></h1>\n <label class=\"api-type-label package\">package</label>\n \n \n \n</header>\n\n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n <p>Implements a set of directives and providers to communicate with native DOM elements when building forms\nto capture user input.</p>\n\n <p>Use this API to register directives, build form and data models, and provide validation to your forms. Validators can\nbe synchronous or asynchronous depending on your use case. You can also extend the built-in functionality\nprovided by forms in Angular by using the interfaces and tokens to create custom validators and input elements.</p>\n<p>Angular forms allow you to:</p>\n<ul>\n<li>Capture the current value and validation status of a form.</li>\n<li>Track and listen for changes to the form's data model.</li>\n<li>Validate the correctness of user input.</li>\n<li>Create custom validators and input elements.</li>\n</ul>\n<p>You can build forms in one of two ways:</p>\n<ul>\n<li><em>Reactive forms</em> use existing instances of a <code><a href=\"api/forms/FormControl\" class=\"code-anchor\">FormControl</a></code> or <code><a href=\"api/forms/FormGroup\" class=\"code-anchor\">FormGroup</a></code> to build a form model. This form\nmodel is synced with form input elements through directives to track and communicate changes back to the form model. Changes\nto the value and status of the controls are provided as observables.</li>\n<li><em>Template-driven forms</em> rely on directives such as <code><a href=\"api/forms/NgModel\" class=\"code-anchor\">NgModel</a></code> and <code><a href=\"api/forms/NgModelGroup\" class=\"code-anchor\">NgModelGroup</a></code> create the form model for you,\nso any changes to the form are communicated through the template.</li>\n</ul>\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#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p>Find out more in the <a href=\"guide/forms-overview\">Forms Overview</a>.</p>\n</li>\n </ul>\n</section>\n\n\n\n \n <h2 id=\"entry-points\">Entry points<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms#entry-points\"><i class=\"material-icons\">link</i></a></h2>\n \n \n \n <section class=\"export-list\">\n <h3 id=\"primary\">Primary<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/forms#primary\"><i class=\"material-icons\">link</i></a></h3>\n <table class=\"is-full-width list-table\">\n \n <tbody><tr>\n <td><code class=\"code
|
||
|
}
|