I have a problem with an Angular2 application when I create it for Android (maybe this problem also occurs in iOS, but I have not tested it yet). When starting up, the following error message appears:
EXCEPTION: Error: Uncaught (in promise): Cannot match any routes. Current segment: 'android_asset'. Available routes: ['', '/login', '/register', '/lostpw', '/resetpw', '/content'].
Because of this, the application start page does not load. To make the application work at all, I had to replace the base tag in index.html from
<base href="/">
to
<base href="file:///android_asset/www/" target="_blank">
But as said, the router is trying to enable android_asset. With the application, I can click on a menu item like
<a [routerLink]="['/']">Home</a>
and I successfully redirected to the home route.
Does anyone know how to solve the problem at startup?
Version: Angular 2.0.0-rc.1
source share