小编Thi*_*nry的帖子

NgRX实体:ID在州内未定义

我一直在虚拟的"Todo"项目中尝试@ ngrx/entity,只有一个AppModule,一个减速器和一个组件.但是,我在试用它时遇到了问题.

我的行为很简单,只是一些CRUD操作:

import { Action } from '@ngrx/store';
import { Todo }  from '../../models/todo';


export const CREATE = '[Todo] Create'
export const UPDATE = '[Todo] Update'
export const DELETE = '[Todo] Delete'

export class Create implements Action {
    readonly type = CREATE;
    constructor(public todo: Todo) { }
}

export class Update implements Action {
    readonly type = UPDATE;
    constructor(
        public id: string,
        public changes: Partial<Todo>,
      ) { }
}

export class Delete implements Action {
    readonly type = DELETE; …
Run Code Online (Sandbox Code Playgroud)

javascript entity rxjs ngrx angular

9
推荐指数
1
解决办法
5128
查看次数

标签 统计

angular ×1

entity ×1

javascript ×1

ngrx ×1

rxjs ×1