docs(forms): update form builder API reference (#24693)

PR Close #24693
This commit is contained in:
Brandon Roberts
2018-06-27 14:33:16 -05:00
committed by Matias Niemelä
parent 9a6f27c34c
commit 80a74b450a
3 changed files with 67 additions and 32 deletions

View File

@ -6,9 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
// #docregion Component
// #docregion Component, disabled-control
import {Component, Inject} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
// #enddocregion disabled-control
@Component({
selector: 'example-app',
@ -40,3 +41,19 @@ export class FormBuilderComp {
}
}
// #enddocregion
// #docregion disabled-control
@Component({
selector: 'app-disabled-form-control',
template: `
<input [formControl]="control" placeholder="First">
`
})
export class DisabledFormControlComponent {
control: FormControl;
constructor(private fb: FormBuilder) {
this.control = fb.control({value: 'my val', disabled: true});
}
}
// #enddocregion disabled-control