angular - “ng g module”在 Angular 8 的模块内生成了一些奇怪的代码
问题描述
我正在执行命令:
ng g module componentes/top-bar --routing
我查看了 top-bar.module.ts 里面有这样的狗屎:
{
"_from": "@types/webpack-sources@^0.1.5",
"_id": "@types/webpack-sources@0.1.5",
"_inBundle": false,
"_integrity": "sha512-zfvjpp7jiafSmrzJ2/i3LqOyTYTuJ7u1KOXlKgDlvsj9Rr0x7ZiYu5lZbXwobL7lmsRNtPXlBfmaUD8eU2Hu8w==",
"_location": "/@types/webpack-sources",
"_phantomChildren":
在 top-bar-routing.module.ts 中有一些不需要的东西。
这开始突然发生了。我已经在同一个应用程序中生成了模块,我没有改变它之前工作的任何东西并且工作正常。
解决方案
我可以在网上搜索解决方案,但我采取了有保证的方式。我生成了一个新项目,现在我将把我所有的代码传递给新项目,有趣的东西!半天没了。昨天我用“ng new”输了半天。这个错误同样奇怪。这将是一个“Angular周”。
推荐阅读
- json - 无法通过 fetch 获取搜索结果 - Github API
- ios - 从 json iOS swift 解析字符串值时获取空值
- sql - 如何更新让两个字段为空/未填充/空的数据库表
- java - 在不同线程中调用 SQL 更新后如何修复“SQLException SQL0913”
- yaml - 使用 CouchDB 的 Hyperledger Fabric 客户端凭证存储
- kubernetes - KubeConfig 文件是如何使用的?
- javascript - jQuery单击更改颜色正在工作,但出现问题更改字体系列
- ios - 使用未解析的标识符“连接”;您是指Auth0中的“连接”吗?
- c# - 单击检查按钮时如何删除/删除按钮文本?
- typescript - 打字稿:定义没有字段的类型