export class FormBuilder
export class FormBuilder
exported from angular2/common defined in angular2/src/common/forms/form_builder.ts (line 4)
Creates a form object from a user-specified configuration.
Example (live demo)
Annotations
@Injectable()
@Injectable()
Members
group(controlsConfig: {[key: string]: any}, extra?: {[key: string]: any}) : ControlGroup
group(controlsConfig: {[key: string]: any}, extra?: {[key: string]: any}) : ControlGroup
Construct a new ControlGroup
with the given map of configuration.
Valid keys for the extra
parameter map are optionals
and validator
.
See the ControlGroup
constructor for more details.
control(value: Object, validator?: Function, asyncValidator?: Function) : Control
control(value: Object, validator?: Function, asyncValidator?: Function) : Control
Construct a new Control
with the given value
,validator
, and asyncValidator
.
array(controlsConfig: any[], validator?: Function, asyncValidator?: Function) : ControlArray
array(controlsConfig: any[], validator?: Function, asyncValidator?: Function) : ControlArray
Construct an array of Control
s from the given controlsConfig
array of
configuration, with the given optional validator
and asyncValidator
.