Routing and navigation in Angular 2

前端 未结 6 1468
误落风尘
误落风尘 2020-12-06 17:45

I am going through the tutorials for Angular 2 and have been able to get a simple application up and running. Now, I am moving on to the routing and navigation part found h

6条回答
  •  庸人自扰
    2020-12-06 18:12

    You can fix the error by implementing hash location strategy:

    To enable HashLocationStrategy it's like this:

    RouterModule.forRoot(routes, {useHash: true})
    

    URL can contain some data prepended with a # character.

    The # part of the URL is called the hash fragment. It’s never sent to the server,

    example: http://example.com/#/clients

提交回复
热议问题