Search code examples
angularangular6ngrxngrx-effects

Angular Can't resolve all parameters for SomeEffect (?)


i am having an issue with "ngrx/effects" library where it cannot resolve the parameter(s) given to the effect class below...

some.effect.ts

import { Injectable } from '@angular/core';
import { Action } from '@ngrx/store';
import { Effect, Actions } from '@ngrx/effects';

@Injectable()
export class SomeEffect {

   constructor( private actions$: Actions ) { }

   @Effect()
   someAction: Observable<Action> = this.actions$.ofType
   ...
}

app.module.ts

@NgModule({
    imports: [
        StoreModule.forRoot(reducers, {metaReducers}),
        EffectsModule.forRoot([SomeEffect])
    ]
})
export class AppModule {}

produces the error ...

Uncaught Error: Can't resolve all parameters for SomeEffect: (?).

Has anyone come into this issue before?


Solution

  • Running the Angular CLI as --AOT solved this issue.