Initialize using patchValue for template driven forms
问题 I use template driven and am trying to initialize my form using patchValue and it is not working. I can make it work if I use two-way binding to set values [(fooBar)] or even setTimeout but I was just wondering, is there a way to make it work with just patchValue? https://stackblitz.com/edit/angular-fft2c5 Thank you. 回答1: It doesn't work because at the time of calling patchValue method there are no any controls registered in your form yet . Why? That's because Template-driven forms are