0
在Angular2rc6,我的模塊如下,其中AppComponent,AppService服務,點是一個組成部分,注射服務和數據模型:angualr2:其中申報模式ngModule
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { AppService } from './app.service';
import { Point } from './point.model';
@NgModule({
imports: [
BrowserModule
],
providers: [
AppService
],
declarations: [
AppComponent, Point
],
bootstrap: [
AppComponent
]
})
export class AppModule { }
頁面拋出錯誤時模型Point
是添加到declaration
。
有什麼想法?
你能告訴我們'point.model.ts'文件嗎? – yurzui
點應該不在聲明中。那些是指令和管道。 –
什麼是Point應該做什麼或做什麼?你爲什麼將它添加到聲明中? –