docs(forms): update form builder API reference (#24693)
PR Close #24693
This commit is contained in:

committed by
Matias Niemelä

parent
9a6f27c34c
commit
80a74b450a
@ -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
|
Reference in New Issue
Block a user