【发布时间】:2017-10-25 20:40:36
【问题描述】:
嗨,我有这个来自 Angular Can't resolve all parameters for RoomService: (?). 的错误,我有这两个文件,是服务。
room.service.ts
import { Injectable } from '@angular/core';
import { ResourceService } from './resource.service';
import { Http } from '@angular/http';
import { CONFIG as APP_CONSTANTS } from '../config/config';
@Injectable()
export class RoomService extends ResourceService {
constructor(http) {
super(http);
}
}
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
// Angular Material
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialComponents } from '../ngcomponents/material.component';
import { AppRoutingModule } from './app-routing.module';
// Components
import { AppComponent } from './app.component';
import { RoomlistComponent } from './components/roomlist/roomlist.component';
// services
import { HttpModule } from '@angular/http';
import { RoomService } from './services/room.service';
@NgModule({
declarations: [
AppComponent,
RoomlistComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HttpModule,
BrowserAnimationsModule,
MaterialComponents
],
providers: [RoomService],
bootstrap: [AppComponent]
})
export class AppModule { }
我不知道问题是什么所以。
【问题讨论】: