mat-label' is not a known element code example

Example 1: 'mat-form-field' is not a known element

@NgModule({
  imports: [
  	...
	MatFormFieldModule,
    MatInputModule,
    ...
  ]
})

Example 2: 'mat-checkbox' is not a known element

import { MatCheckboxModule } from '@angular/material/checkbox';

TestBed.configureTestingModule({
   imports: [
        MatCheckboxModule
   ],
   declarations: [AddAlarmsFormComponent]
})

Example 3: 'mat-label' is not a known element:

// common-widgets.module.ts
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';

@NgModule({
  imports: [
    MatFormFieldModule,
    MatInputModule
  ]
})
export class CommonWidgetsModule { }