## FormBuilder
通过用户指定的配置创建`AbstractCotnrol`
它实际上是一个在使用`new FormGroup()`, `new FormControl()`和`new FormArray()`构建大型表单时的语法糖和简洁方式。
### Class
```typescript
class FormBuilder {
group(controlsConfig: {[key: string]: any}, extra?: {[key: string]: any}) : FormGroup
control(formState: Object, validator?: ValidatorFn|ValidatorFn[], asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]) : FormControl
array(controlsConfig: any[], validator?: ValidatorFn, asyncValidator?: AsyncValidatorFn) : FormArray
}
```
### 属性
- group(controlConfig: {[key: `string`]: `any`}, extra?: {[key: `string`]: `any`}) : `FormGroup` 通过指定的配置创建`FormGroup`,可选参数`extra`的效参数为`validator`和`asyncValidator`序列。
- control(formState: `Object`, validator?: `ValidatorFn`|`Validator[]`, asyncValidator?: `AsyncValidtorFn`|`AsyncValidatorFn[]`) : `FormControl`
根据指定的`formState`, `validator`, 和 `asyncValidator` 创建一个新的`FormControl`。
`formState`可以是一个单独值,也可以是一个包含值和禁用状态的以对象。
- array(controlConfig: `any[]`, validator?: `ValidatorFn`, asyncValidator?: `AsyncValidatorFn`) : `FormArray`
从给定的`controlsConfig`数组创建`FormArray`,`validator`和`asyncValidator`为可选参数。
- 说明
- angular 1.x
- ngModelController
- ngOptions
- ngModelOptions
- lifecycle
- directive
- angular 2
- @angular/forms
- 类
- AbstractControl
- AbstractControlDirective
- AbstractFormGroupDirective
- FormControl
- FormArray
- FormBuilder
- FormGroup
- NgControl
- 接口
- controlValueAccessor
- 指令
- DefaultValueAccessor
- Angular 2 生命周期
- OnInit
- DoCheck
- @angular/router
- 配置
- Routes
- 指令
- RouterOutlet
- RouterLink
- 接口
- ActivatedRoute
- UrlTree
- NavigationExtras
- ActivatedRouteSnapshot
- RouterStateSnapshot
- 类
- UrlSegment
- UrlSegmentGroup
- UrlSerializer
- DefaultUrlSerializer
- Router
- bug记得
- @angular/http
- 类
- Http
- Body
- Response
- ResponseOptions
- Header
- Request
- RequestOptions
- URLSearchParams
- @angular/core
- decorator
- Component-decorator
- animation
- DI
- linker
- TemplateRef
- ElementRef
- EmbeddedViewRef
- ViewRef
- ViewContainerRef
- Query
- ComponentFactory
- ComponentRef
- Renderer
- change_detection
- KeyValueDiffers
- IterableDiffers
- ChangeDetectorRef
- ChangeDetectionStrategy
- Zone
- ngZone
- @angular/common
- 指令
- NgTemplateOutlet
- QueryList
- bootstrap4
- card
- form
- 重点关注博客
- 学习过的文章
- 笔记
- Angular 2 双向绑定
- 将字符串解析成DOM
- rx相关
- operators
- combineLatest
- combineAll
- concat(All, Map, *MapTo)
- 背压(backpressure)
- js事件keycode对应表
- 装饰器
- 有用的代码摘录
- 日期操作
- 数量操作
- 字符操作
- rxjs问题
- 小示例
- h5面试准备
- react
- 开发遇到的问题