I\'m following the simple quickstart app from the Angular2 docs and I\'m using a spring backend to run it. My problem is that the angular router ditched the hashtag from the
With your implementation everything seems perfect.
Now, Please try to delete browser's cache memory
and try. I hope it will start working !!!
I faced this problem when trying for your problem.
Angular2 <= RC.5
The ROUTER_PROVIDERS
need to be added before LocationStrategy
otherwise your previously added LocationStrategy
gets overridden.
bootstrap(
TestComponent,
[
ROUTER_PROVIDERS,
// must be listed after `ROUTER_PROVIDERS`
provide(LocationStrategy, { useClass: HashLocationStrategy })
]
);
delete this line
providers: [ROUTER_PROVIDERS]
from TestComponent