Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public myForm: FormGroup
- constructor(private formBuilder: FormBuilder) { }
- ngOnInit() {
- this.myForm = this.formBuilder.group({
- enabledControl: ['hello'],
- disabledControl: [{
- value: 'world',
- disabled: true
- }],
- })
- console.log(this.myForm.value)
- /*
- Outputs:
- {
- enabledControl: 'hello'
- }
- */
- console.log(this.myForm.getRawValue())
- /*
- Outputs:
- {
- enabledControl: 'hello',
- disabledControl: 'world'
- }
- */
- }
Add Comment
Please, Sign In to add comment