为什么我的 angular 路由显示空白页?

Why does my angular routing shows blank page?

应用模块 [在此处输入图片描述][1] 应用路由 [在此处输入图片描述][2] 浏览器 [在此处输入图片描述][3] [1]: https://i.stack.imgur.com/RSfRA.png [2]: https://i.stack.imgur.com/cKcsw.png [3]: https://i.stack.imgur.com/sUO2X.png

你在html使用路由器插座吗?

< router-outlet ></ router-outlet >

确保您在 *.component.html 中使用 <router-outlet></router-outlet> 来显示路由组件。

同时仔细检查您是否在 app-module.tsapp-routing.module.ts 中导入 RouterModule(取决于您的路由设置位置)

认为您没有导入路由器模块。尝试将路由器模块导入到您的应用程序 module.ts 并在 html 页面中使用 。认为您还没有导入路由器模块