angular - 未处理的承诺拒绝:[object Object] 没有提供者!; 区:; 任务:Promise.then;值:错误:[object Object] 没有提供者!
问题描述
我正在尝试将ngrx 效果添加到我的角度应用程序中。
我做了这样的效果->
import { HttpService } from './../../../shared/services/common/http.service';
import { Injectable, Inject } from '@angular/core';
import * as ItemsListActions from './itemsList.actions';
@Injectable()
export class ItemsListEffects {
// Listen for the 'LOGIN' action
constructor(@Inject(HttpService) private _http: HttpService, @Inject(ItemsListActions) private _actions$: ItemsListActions) {}
}
我删除了内容导致错误始终出现
在 appModule 我有
@NgModule({
imports: [
EffectsModule.forRoot([ItemsListEffects]),
]
})
但是当我编译时我有
Unhandled Promise rejection: No provider for [object Object]! ; Zone: <root> ; Task: Promise.then ; Value: Error: No provider for [object Object]!
如果我评论导入,没有错误。
但我不明白我的错误
解决方案
似乎@Inject
模块不提供构造函数中的 'ed 属性。
推荐阅读
- c# - 如何检查 RichTextBox 中的文本是否带下划线?
- react-native - 如何在 react-native (expo) 中出现致命错误时运行重置脚本?
- javascript - 在繁重的渲染/计算过程中,如何防止在冻结后滚动位置跳跃?
- c# - Exchange Web 服务 API 和 401 未经授权但成功
- windows - 由 Powershell 代码重命名的文件具有相同的名称,但是其中一个的第一部分没有被删除?
- kustomize - 如何使用 kustomize 创建命名空间?
- python-3.x - \将字段内带双引号的 CSV 复制到表中
- php - Mysql - 不插入多于一行
- javascript - 将处理转换为 javascript
- javascript - 通过快递获取和传递图像的问题