angular - 是否有一些示例可以在一个命令中在 Angular 7 上创建 ngrx/Store
问题描述
我正在创建新的 Web 仪表板并使用 ngrx/store 在 Angular 7 中加载和数据。大约第三次我正在为不同的商店界面创建和生成文件,并且它似乎不会在这里停止。所以我想知道是否有一些 cli 包可以在一个命令行中为模块创建存储。
我每次都最好使用 cli 来创建动作、效果、减速器、状态。我尝试了一些来自 cli 的解决方案,但它只创建了 reducer 和 index.ts。
npm install @ngrx/schematics --save-dev
npm install @ngrx/{store,effects,entity,store-devtools} --save
ng config cli.defaultCollection @ngrx/schematics
ng generate @ngrx/schematics:store State --root --module some-app.module.ts -d
解决方案
可能是ng update
命令,例如https://ngrx.io/guide/store/install#installing-with-ng-add
ng add @ngrx/store
这将安装@ngrx/store
并做一个最小的脚手架让你开始。
推荐阅读
- reactjs - 为什么从我的 React 应用程序通过 Lambda 从 AWS DynamoDB 获得响应非常慢?
- sql - 如果不满足选择查询中的条件,则将值插入表中
- python - OSError: [WinError 193] %1 不是有效的 Win32 应用程序 - nltk
- jms - Artemis:java.net.BindException:无法分配请求的地址
- java - 如何将 Paging 3 从 Kotlin Flow 移植到 Java?- 找不到 PagingDataFlow.create 函数
- python - 日志记录本身的 Python 异常处理
- flutter - 如何在颤动中将小部件屏幕截图存储为 jpg 文件?
- laravel - 如何修复 Laravel 表离开页面
- javascript - state with different name but same array changed
- bots - 如何在等待反应中使用两个以上的自定义表情符号?