Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用命令创建模块时:
ng g m dashboard --routing
它为此模块创建具有适当路由配置的模块。Angular CLI 是否可以自动将主路由与该子路由链接起来,还是我总是需要自己编辑主路由配置?
在命令中添加参数--module,如下所示:
--module
ng g m dashboard --routing --module app(假设您的目标模块名称是 app)
ng g m dashboard --routing --module app