## 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
- 開發遇到的問題