Angular 2 Uncaught Error:无法解析Service的所有参数

时间:2017-02-06 12:27:12

标签: angular

我收到服务的以下错误: 未捕获错误:无法解析FormFlowService的所有参数:(AnnounceObjectService,?)

我没有红线,我已在我的app模块中声明了该服务。有人知道原因吗?注意我在其他服务中使用FormService而没有此错误。

我的服务如下:

import { Injectable } from '@angular/core';
import { FormService } from './form.service';
import { FormFlow, FormFlowTask, FormTaskReference, FormTaskAssign, FormTask, FormTaskState, FormTaskAssignActive } from './form';
import { AnnounceObjectService } from '../../../shared/services/announce-object/announce-object.service';
import * as _ from "lodash"; //Will be red but stil works
import { Subscription }   from 'rxjs/Subscription';

@Injectable()
export class FormFlowService {
  subscription: Subscription;
  tasks: FormFlowTask[];
  taskReference: FormTaskReference;
  flow: FormFlow;
  stateList: FormTaskState[];
  taskList: FormTask[];  
  assignList: FormTaskAssign[];
  stateListBase: number;
  assignListBase: number;  
  isQueFlow: boolean;
  constructor(private announceObjectService: AnnounceObjectService, private formService: FormService) { 

  }   

}

应用模块:

@NgModule({
  declarations: [
    AppComponent  
  ],
  entryComponents: [
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    routing,
    MaterialModule.forRoot(),
    FlexLayoutModule.forRoot()
  ],
  providers: [
  { provide: LOCALE_ID, useValue: 'en-AU' },
  AUTH_PROVIDERS, 
  FormService, 
  FormFlowService,
  FormElementService,
  AnnounceObjectService

  ],
  bootstrap: [AppComponent]
})

0 个答案:

没有答案