无法绑定到“ ngForOf”,因为它不是“ tr”的已知属性。甚至导入CommonModule / BrowserModule

时间:2018-07-05 18:28:41

标签: javascript angular angular5 angular2-directives angular6

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 {}

`

0 个答案:

没有答案