@pankajparkar
@pankajparkar
Technical Lead, Synerzip
@pankajparkar
(too specific and simpler requirement)
@pankajparkar
user-profile.component.html
user-profile.component.ts
User Address
@pankajparkar
| Accesor | Form Element |
|---|---|
| DefaultValueAccessor | input, textarea |
| CheckboxControlValueAccessor | input[type=checkbox] |
| NumberValueAccessor | input[type=number] |
| RadioControlValueAccessor | input[type=radio] |
| RangeValueAccessor | input[type=range] |
| SelectControlValueAccessor | select |
| SelectMultipleControlValueAccessor | select[multiple] |
Above all classes inherits from ControlValueAccessor
registerOnTouched
setDisabled
@pankajparkar
const DEFAULT_CONTROLVALUEACCESSOR: Provider = {
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef(() => RadioGroupComponent)
}@Component({
selector: 'cb-radio-group',
templateUrl: './radio-group.component.html',
styleUrls: ['./radio-group.component.css'],
providers: [DEFAULT_CONTROLVALUEACCESSOR]
})
export class RadioGroupComponent {
...
}@pankajparkar
@pankajparkar
@pankajparkar
@pankajparkar
@pankajparkar