Angular Difference ViewChild vs ControlValueAccessor
问题 What's the difference between ViewChild and ControlValueAccessor in Angular? Seems both of them can access child components, directives, DOM. So curious about the differences in usage, can one do something the other cannot do? 回答1: ControlValueAccesor is for making a custom form control . By steps, a FormControl can store anything, even an object. Imagine two different FormGroups form1=new FormGroup({ name:new FormControl('name') direcction:new FormControl({address:'address',cp:'cp'}) })