Hash Location Strategy in Angular 2

后端 未结 4 787
梦如初夏
梦如初夏 2020-12-06 18:16

I\'m trying to create an application with hash location strategy, but it does not add the hash to the url. For instance when I click on a button associated with { path: \'/p

4条回答
  •  佛祖请我去吃肉
    2020-12-06 18:59

    You can use the option "useHash" in RouterModule.forRoot().

    RouterModule.forRoot(appRoutes, {useHash: true});
    

    https://discuss.atom.io/t/angular-2-routes-breaking-on-electron-app-refresh/28370/4

提交回复
热议问题