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
Add this line to your component.spec.ts:
import {FormsModule} from '@angular/forms';
imports: [
RouterTestingModule,
FormsModule
],
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">