Angular - Troubleshooting - BuildErrors

A statement like this

1
<form [formGroup]="lessonForm"  >

Fails with the error

1
Can't bind to 'formGroup' since it isn't a known property of 'form'

Summary
[formGroup] is an angular thing

The fix
Make sure the module has the name if the component in the declarations module.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
lesson.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { LessonListComponent } from './lesson-list/lesson-list.component';
import { LessonDetailsComponent } from './lesson-details/lesson-details.component'; // ******** Add this
import { SweetAlert2Module } from '@sweetalert2/ngx-sweetalert2';
import { NgxPaginationModule } from 'ngx-pagination';

@NgModule({
declarations: [
LessonListComponent,
LessonDetailsComponent, // ******** And this
],
imports: [

Other Errors

[[MatFormFieldControlError]] - mat-form-field must contain a MatFormFieldControl