Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular 2: Uncaught (in promise): TypeError: Cannot read property 'setParent' of null

Tags:

angular

All of a sudden this error occurs in my component:

"Uncaught (in promise): TypeError: Cannot read property 'setParent' of null"

I will try to reproduce in a plunkr, in the meantime maybe someone can throw me some hints?

like image 352
Tobias Gassmann Avatar asked Jul 14 '16 07:07

Tobias Gassmann


1 Answers

Solved it:

I was switching from a model-driven form to a template-driven form. I missed to remove one occurance of a "formControlName" on an input-element.

The "formControlName" on the input-element referenced a formControl that did not exist anymore on the component.

like image 77
Tobias Gassmann Avatar answered Oct 03 '22 11:10

Tobias Gassmann