1
votes

I'm trying to import my own custom module into the app module and I keep getting this error.

"Uncaught Error: Unexpected value 'ActionsService' imported by the module 'ReduxStoreModule'. Please add a @NgModule annotation."

It wants me to add a @NgModule annotation, but I have @NgModule in both of my Modules. I don't know what I am doing wrong. Please help.


app.module.ts

import { BrowserModule } from '@angular/platform-browser'
import { NgModule } from '@angular/core'
import { AppComponent } from './app.component'
import { ReduxStoreModule } from './Redux-Store/redux-store.module'

@NgModule( {
    declarations: [ AppComponent ],
    imports: [
        BrowserModule
        ,ReduxStoreModule
    ],
    providers: [],
    bootstrap: [ AppComponent ]
} )
export class AppModule { }

redux-store.module.ts

import { CommonModule } from '@angular/common'
import { NgReduxModule } from '@angular-redux/store'
import { NgModule } from '@angular/core'
import { ActionsService } from './actions'

const ImportsExports = [
    ActionsService
    ,NgReduxModule
]

@NgModule( {
    imports: ImportsExports
    ,exports: ImportsExports
} )
export class ReduxStoreModule { }
1

1 Answers

3
votes

services should be under providers not under modules, remove ActionsService from module and add it under provider,

const ImportsExports = [
  NgReduxModule
]