如何清除角度无效的动作错误

时间:2018-06-26 06:23:18

标签: javascript angular

尝试单击按钮从服务器获取数据时,我得到invalid action error。单击按钮获取数据。bu我收到此错误

preview-fe7237b13d780dbf847da.js:1 ERROR Error: Effect "BanklistEffect.recipeFetch" dispatched an invalid action: [object Object]
    at reportInvalidActions (effects.umd.js:sourcemap:185)
    at verifyOutput (effects.umd.js:sourcemap:173)
    at MapSubscriber.eval [as project] (effects.umd.js:sourcemap:231)
    at MapSubscriber._next (map.ts:78)
    at MapSubscriber.Subscriber.next (Subscriber.ts:102)

这是我的代码

点击事件句柄

https://stackblitz.com/edit/angular-kewril?file=src%2Fapp%2Fapp.component.ts

fetchData(){
    this.store.dispatch(new FetchBankList());
  }

我正在使用ngrx进行状态管理。我想获取此数据并显示在页面上

1 个答案:

答案 0 :(得分:0)

您应该从效果中返回动作,而不是Observable:

import {Promise} from 'es6-promise'