应用程序源代码:https ://github.com/shardul-shah/first-angular-app
它适用于 gh-pages ......有点(https://shardul-shah.github.io/first-angular-app/)
问题:
- 当转到https://shardul-shah.github.io/first-angular-app/时,URL 会自动更改为https://shardul-shah.github.io/first-angular-app/first-angular -应用程序/
- 刷新https://shardul-shah.github.io/first-angular-app/first-angular-app/(或任何路线上的任何刷新)会导致白色的空白屏幕。
- 当我单击https://shardul-shah.github.io/first-angular-app/first-angular-app/中的“我的商店”时,该应用程序有效,但并非没有。
我看到了 JS 控制台,我发现我也遇到了路由问题。我可以看到路由存在问题,但我一生都无法弄清楚如何解决它。我已经尝试使用 ng 和 ng 的 gh-pages 命令行实用程序进行 4 次重建和保留,但它没有修复它。我对 Angular 和路由的缺乏经验很痛苦。
谁能告诉我如何修复此路由,以使应用程序正常运行并从https://shardul-shah.github.io/first-angular-app/运行?
仅供参考,它适用于 stackblitz,我最初在该应用程序上工作: https ://angular-n2rqei.stackblitz.io和https://stackblitz.com/edit/angular-n2rqei?file=src/app/app.module .ts
谢谢!