错误 Angular 13:任何指令均未使用 ngForOf...无法绑定到“ngForOf”

Jes*_*v05 2 typescript visual-studio-code angular angular13

我收到这个错误

Property binding ngForOf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". > 
Run Code Online (Sandbox Code Playgroud)

无法绑定到“ngForOf”,因为它不是“a”的已知属性

我已经导入了所有必需的模块: CommonModuleBrowserModuleReactiveFormsModule

应用程序模块.ts:

import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { RecipesComponent } from './components/recipes/recipes.component';
import { RecipeListComponent } from './components/recipes/recipe-list/recipe-list.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    RecipesComponent,
    RecipeListComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    ReactiveFormsModule,
    CommonModule,
  ],
  providers: [],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)

食谱列表.component.ts :

Property binding ngForOf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". > 
Run Code Online (Sandbox Code Playgroud)

我正在使用 Angular v13.1.1 / Node v16.13.1 / VSCode v1.63.2

我的错误屏幕

小智 5

禁用 Visual Studio 扩展“Angular Language Service”解决了该问题。