2017-11-04 208 views
0

我有這樣的錯誤創造了一個新的角度成分後,在創建後我定義它app.module.shared.ts:找不到模塊主server.js

import { NgModule } from '@angular/core'; 
import { CommonModule } from '@angular/common'; 
import { ReactiveFormsModule } from '@angular/forms'; 
import { HttpModule } from '@angular/http'; 
import { RouterModule } from '@angular/router'; 

import { AppComponent } from './components/app/app.component'; 
import { NavMenuComponent } from './components/navmenu/navmenu.component'; 
import { HomeComponent } from './components/home/home.component'; 
import { HistoryGridComponent } from "./components/history/histories-grid.component"; 

@NgModule({ 
    declarations: [ 
     AppComponent, 
     NavMenuComponent, 
     HomeComponent, 
     HistoryGridComponent 
    ], 
    imports: [ 
     CommonModule, 
     HttpModule, 
     ReactiveFormsModule, 
     RouterModule.forRoot([ 
      { path: '', redirectTo: 'home', pathMatch: 'full' }, 
      { path: 'home', component: HomeComponent }, 
      { path: 'history', component: HistoryGridComponent }, 
      { path: '**', redirectTo: 'home' } 
     ]) 
    ] 
}) 
export class AppModuleShared { 
} 

想跑,但它總是返回如下錯誤:

Error

正在發生的事情任何想法?

回答

0

我想你在history-grid文件夾中刪除了你的history-grid.component.html。如果你確實刪除了你的歷史記錄組件中的「templateUrl」屬性-ts enter image description here

+0

不,html頁面在我的項目文件夾中。 –