angular - 在集合 "store"中找不到示意图 "@schematics/angular"

标签 angular ngrx ngrx-store angular-ngrx-data

我使用以下命令安装 ngrx/store:

ng add @ngrx/store 
然后我想添加商店
ng generate store auth/Auth --module auth.module.ts
得到以下错误:

An unhandled exception occurred: Schematic "store" not found in collection "@schematics/angular". See "xxx\angular-errors.log" for further details.

最佳答案

因为 ngrx 不是直接的 Angular 示意图。 Ngrx 是一个外部库,它支持向 angular 项目添加文件或创建文件
您应该从 ngrx 原理图 json 文件生成商店文件,为此您应该运行如下命令
ng generate @ngrx/schematics:store State --root --module app.module.ts
您可以在此处找到其用法的详细文档:enter link description here

关于angular - 在集合 "store"中找不到示意图 "@schematics/angular",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62725724/

相关文章:

angular - 防止 NGRX 效应产生的冗余 API 调用

angular - ngrx/store 未显示表单的更新值

angular - Ngrx:如何简化 Action 的定义?

angular - declarations 和 entryComponents 有什么区别

angular - 如何通过 ngrx 存储中的单个操作更新多个 reducer 的状态?

angular - 如何从子组件打开 MdSidenav?

angular - 使用 LocalStorage 中的 AuthToken 为 NgRx Store 补水的正确方法和位置

angular - NGRX Effect 中的内存泄漏

asp.net - *ngFor 未显示任何记录

javascript - Angular 传递标签名称