No provider for ControlContainer - Angular 5

后端 未结 8 1168
萌比男神i
萌比男神i 2020-12-09 14:26

I am converting a purchased, third-party template into an Angular 5 app, and just ran into an error. I am very new to Angular 5 (I know AngularJS well however) and don\'t un

相关标签:
8条回答
  • 2020-12-09 15:29

    Add this line to your component.spec.ts:

    import {FormsModule} from '@angular/forms';
    
    imports: [
      RouterTestingModule,
      FormsModule
    ],
    
    0 讨论(0)
  • 2020-12-09 15:31

    I'm not sure why the error seems to be pointing to the anchor tag outside of the form element, but it was the form element that was causing the error. Adding FormGroup to the form fixed the problem.

    <form role="search" class="navbar-form-custom" [formGroup]="form">
    
    0 讨论(0)
提交回复
热议问题