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

前端 未结 5 825
名媛妹妹
名媛妹妹 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:30

    I have received the same error, initialize error, but it was the result of a typo.

    Instead of typing ngOnInit, I wrote ngOninit (must be capital I)

    but the error was same, group initialization, it's difficult to time the solution for these kinds of typo error, so I thought this might be useful for others in the future.

提交回复
热议问题