小编Tig*_*sus的帖子

angular ngrx store error无法读取undefined的属性'schedule'

我尝试使用Angular实现ngrx/Store但是我总是在控制台中收到以下错误,并且没有显示任何内容:

"TypeError:无法在ObserveOnSubscriber.scheduleMessage中读取未定义的属性'schedule'"

顺便说一下我使用的方式:

Angular CLI:1.7.4
Angular:5.2.11

由于我是ngrx/Store的新手,我试图实现以下示例:https://malcoded.com/posts/angular-ngrx-guide

即使我尝试了其他示例,但我总是得到相同的上述错误.

redux ngrx angular ngrx-store

12
推荐指数
1
解决办法
3434
查看次数

ngrx/store 不显示表单的更新值

我需要通过表单输入 2 个输入值,以兆字节为单位显示存储空间的使用情况(已使用空间和剩余空间),并显示来自 ngrx/Store 的输入值。每次提交表单时,都会显示新值并更新旧值。问题是 UI 始终显示(used_space 和剩余空间)的默认值,并且我不知道我的架构是否正确,因为我是 ngrx/store 的新手。

模型(usage.model.ts):

   export interface Usage {
      used_space: number;
      remaining_space: number;
    }
Run Code Online (Sandbox Code Playgroud)

操作(usage.actions.ts):

export const EDIT_USAGE  = '[Usage] Edit';
...
export class EditUsage implements Action {
  readonly type = EDIT_USAGE
  constructor(public payload: Usage) {}
}
...
export type All = Reset | EditUsage;
Run Code Online (Sandbox Code Playgroud)

Reducer(usage.reducer.ts): 导出类型Action=UsageActions.All;

/// Default app state
const defaultState: Usage = {
  used_space: 2,
  remaining_space: 3
}

/// Helper function to create new state object
const newState = (state, newData) …
Run Code Online (Sandbox Code Playgroud)

redux ngrx ngrx-effects angular ngrx-store

5
推荐指数
1
解决办法
7245
查看次数

标签 统计

angular ×2

ngrx ×2

ngrx-store ×2

redux ×2

ngrx-effects ×1