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

1

7

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 })
Cradlesong answered 20/3, 2018 at 6:27 Comment(1)
Did you find exact answer to this question. If yes, Please post.Bellay
S
4

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

Styrax answered 20/3, 2018 at 6:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.