无法通过离子路由生成角度模块

在离子项目中生成带有路由的模块时遇到问题。

我从ionic start routing blank创建了一个新的离子项目。然后生成带有路由的模块,如下所示。

ionic g m heroes --route heroes --module app-routing.module

ng g m heroes --route heroes --module app-routing.module

我收到此错误。

File heroes/heroes.module.ts does not exist.
[ERROR] Could not generate module.

如果我在纯Angular项目中生成像这样的模块,它就可以正常工作。 我使用了Ionic 5.4.4和Angular 8。

wjt19871002 回答:无法通过离子路由生成角度模块

使用相对于您的基本href的路径src/app。尝试如下。

ng g m heroes --route --module app-routing.module

希望这会有所帮助。

本文链接:https://www.f2er.com/3139778.html

大家都在问