Angular 未捕获错误:意外值'';由模块导入'';。请添加@NgModule注释
我正在尝试将我自己的自定义模块导入到应用程序模块中,但一直出现此错误Angular 未捕获错误:意外值'';由模块导入'';。请添加@NgModule注释,angular,Angular,我正在尝试将我自己的自定义模块导入到应用程序模块中,但一直出现此错误 "Uncaught Error: Unexpected value 'ActionsService' imported by the module 'ReduxStoreModule'. Please add a @NgModule annotation." 它希望我添加一个@NgModule注释,但我的两个模块中都有@NgModule。我不知道我做错了什么。请帮忙 应用程序模块.ts import { BrowserMo
"Uncaught Error: Unexpected value 'ActionsService' imported by the module 'ReduxStoreModule'. Please add a @NgModule annotation."
它希望我添加一个@NgModule注释,但我的两个模块中都有@NgModule。我不知道我做错了什么。请帮忙
应用程序模块.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 { }
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 { }
redux store.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 { }
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 { }
服务应位于提供程序下而不是模块下,从模块中删除操作服务,并将其添加到提供程序下
const ImportsExports = [
NgReduxModule
]