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应该做什么或做什么?你为什么将它添加到声明中? –