I need to either set <base>
in the HTML or APP_BASE_HREF
during the bootstrap for Angular 2 to not throw exceptions. If I set either of these then Electron
, thinking in terms of the file system, throws exceptions in browser_adapter.ts
when trying to match a route:
EXCEPTION: Error: Uncaught (in promise): Cannot match any routes. Current segment: 'C:'. Available routes: ['/dashboard', '/accounts'].
I tried using just the HashLocationStrategy
mentioned in this blog post, but Angular still complains about the base href not being set.
Since the
href
attribute can take a relative path and thanks to @DavidC and @ChristianRondeau in the comments on the question for verifying, it should work like this: