Datatable.component. html
<tr *ngFor="let articles of art">
我在appmodule / Datatablemodule中添加了CommonModule / BrowserModule无效。...甚至在使用“ form [formGroup] =” loginForm“(ngSubmit)=” onSubmit()“>”时,FormBuilder中也存在同样的错误导入了@ angular / forms
//app.module.ts
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './/app.component';
import { AppRoutingModule } from './/app-routing.module';
import { BrowserModule } from '@angular/platform-browser';
import { ReactiveFormsModule } from '@angular/forms';
import {AddArticleModule} from './pages/add-articles/add-article.module';
import {DatatablesModule} from './pages/datatables/datatables.module';
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
AppRoutingModule,
LayoutModule,
ReactiveFormsModule,
AddArticleModule,
DatatablesModule
],
declarations: [
AppComponent
],
providers: [ScriptLoaderService],
bootstrap: [AppComponent]
})
export class AppModule { }
//Datatables
.module.ts
import { NgModule } from '@angular/core';
import {CommonModule} from '@angular/common';
@NgModule({
declarations: [
],
imports: [
CommonModule
],
exports: []
})
export class DatatablesModule {}
`