Angular 2: formGroup expects a FormGroup instance. Please pass one in

前端 未结 5 839
名媛妹妹
名媛妹妹 2020-12-24 04:58

I am creating a form in Angular 2. My goal is to get data from the API and pass it into the form for editing purposes. However, I am running into this error:

5条回答
  •  孤城傲影
    2020-12-24 05:28

    Problem is that your form is null on the beginning.

    And only on ng init you will get patient and then create it. You should initialize your form on the begining or

提交回复
热议问题