Hash Location Strategy in Angular 2

后端 未结 4 783
梦如初夏
梦如初夏 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 19:01

    Everything worked fine with the sample code OP posted as with what is in the accepted answer. But as a minor note, the format required to changing the Hash Location Strategy in the bootstrap file as of RC.4 goes like this:

    { provide: LocationStrategy, useClass: HashLocationStrategy },
    

提交回复
热议问题