为什么我的ngrx Effect将字符串参数转换为数组? 动作组件效果

问题描述

动作

我将执行以下操作:

requests

组件

我的其中一个组件中包含以下代码

export const searchTM = createAction(
    IocActionTypes.SearchTM,props<{tm: string}>()
);

其中this.store.dispatch(searchTM(value)); 是字符串value

效果

在我的ngrx Effects文件中,我有以下内容

03F

但是当我在mergeMap searchTM$ = createEffect(() => this.actions$.pipe( ofType(iocActions.searchTM),mergeMap(val => this.iocService.getGridRowByTM(val.tm) .pipe( map(rowdataraw => iocActions.searchTMFound({rowdataraw})),catchError(() => { return EMPTY; }) ) ) ) ); 变量上设置调试点时,我看到它像这样出现:

enter image description here

解决方法

问题是我以错误的格式传递了参数。

我正在使用:

val

我应该一直使用的位置:

this.store.dispatch(searchTM(value));