77 lines
1.2 KiB
Plaintext
77 lines
1.2 KiB
Plaintext
|
|
||
|
p.
|
||
|
<span class="location-badge">exported from <a href="/angular2/forms">angular2/forms</a></span>
|
||
|
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/forms/form_builder.js#L26">angular2/src/forms/form_builder.js (line 26)</a>
|
||
|
|
||
|
:markdown
|
||
|
Creates a form object from a user-specified configuration.
|
||
|
|
||
|
# Example
|
||
|
|
||
|
This example creates a [ControlGroup] that consists of a `login` [Control], and a nested [ControlGroup] that defines
|
||
|
a `password` and a `passwordConfirmation` [Control].
|
||
|
|
||
|
```
|
||
|
var loginForm = builder.group({
|
||
|
login: ["", Validators.required],
|
||
|
|
||
|
passwordRetry: builder.group({
|
||
|
password: ["", Validators.required],
|
||
|
passwordConfirmation: ["", Validators.required]
|
||
|
})
|
||
|
});
|
||
|
|
||
|
```
|
||
|
.l-main-section
|
||
|
h2 Members
|
||
|
.l-sub-section
|
||
|
h3 array
|
||
|
|
||
|
|
||
|
pre.prettyprint
|
||
|
code.
|
||
|
(controlsConfig:List, validator:Function = null)
|
||
|
|
||
|
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
.l-sub-section
|
||
|
h3 control
|
||
|
|
||
|
|
||
|
pre.prettyprint
|
||
|
code.
|
||
|
(value, validator:Function = null)
|
||
|
|
||
|
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
.l-sub-section
|
||
|
h3 group
|
||
|
|
||
|
|
||
|
pre.prettyprint
|
||
|
code.
|
||
|
(controlsConfig, extra = null)
|
||
|
|
||
|
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|