Another solution is to enable NgRoutingUsePushState
which seems to not interfere with anchor links or ng-click at all. You just have to remove or comment out the following line in your RoutingModule:
//bind(NgRoutingUsePushState, toValue: new NgRoutingUsePushState.value(false));
To use push state you also have to have your webserver rewrite urls to index.html
. It makes running the app on a local dev server a little more complex but I decided to go for it since I want that functionality eventually and because of this bug. An example nginx config is:
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to index.html
rewrite ^(.+)$ /index.html last;
}
Note: Tested with Angular 0.13.0