Need clarification RouterModule.forRoot([ ABOUT_ROUTE ], { useHash: true })

大憨熊 提交于 2020-07-20 17:34:50

问题


Kindly explain useHash: true method in angular 2 route method.

My Questions:

  1. what is the purpose we using it.

  2. why the value is "true" why not "false" ?

  3. if the value is false, what could be happen ?

RouterModule.forRoot([ ABOUT_ROUTE ], { useHash: true })

回答1:


By default, angular uses HTML5 location-based routing, which may cause you problems in some environments. In the shake of simplicity, we usually prefer hash-based routing which regularly works in every environment. You can have a look at this post for angular 2 routing



来源:https://stackoverflow.com/questions/49377585/need-clarification-routermodule-forroot-about-route-usehash-true

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!