剛纔我「寫」得到一個角度編譯錯誤(複製結構沒有內容)這個小角4模塊:爲什麼我在這個簡單的組件
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { HttpModule } from "@angular/http";
import { FooterComponent } from "./footer.component";
@NgModule({
declarations: [
FooterComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule
],
providers: [],
bootstrap: [FooterComponent]
})
export class FooterModule { }
當我嘗試的angular build
,我得到以下錯誤:
ERROR in C:/Projects/Angular 4/Angular4/src/footer.module.ts (7,1): 'from' expected.
對我來說,7號線,import { FooterComponent } from "./footer.component";
,看上去語法正確,甚至有一個from
。如果from
組件不好,我寧可期待運行時錯誤。
您是否嘗試刪除並重寫(而不是複製過去)此行和之前的行? – Guy
嘗試清理緩存並重新啓動 – Sajeetharan
@Guy,是的,我做到了。 – ProfK