我需要在 Angular 2 中设置
<base>
或者在启动时设置 APP_BASE_HREF
,否则会抛出异常。如果我设置其中任何一个,那么 Electron
在尝试匹配路由时(以文件系统的角度思考)会在 browser_adapter.ts
中抛出异常:
我尝试仅使用此博客文章中提到的EXCEPTION: Error: Uncaught (in promise): Cannot match any routes. Current segment: 'C:'. Available routes: ['/dashboard', '/accounts'].
HashLocationStrategy
,但是 Angular 仍然抱怨没有设置基本的 href。
<base href="./">
。 - Abdulrahman Alsoghayer