Jes*_*v05 2 typescript visual-studio-code angular angular13
我收到这个错误
Run Code Online (Sandbox Code Playgroud)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". >
无法绑定到“ngForOf”,因为它不是“a”的已知属性
我已经导入了所有必需的模块: CommonModule、BrowserModule、ReactiveFormsModule
应用程序模块.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
归档时间: |
|
查看次数: |
3027 次 |
最近记录: |