How to handle anchor hash linking in AngularJS

后端 未结 27 1258
后悔当初
后悔当初 2020-11-22 12:22

Do any of you know how to nicely handle anchor hash linking in AngularJS?

I have the following markup for a simple FAQ-page



        
27条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 13:21

    See https://code.angularjs.org/1.4.10/docs/api/ngRoute/provider/$routeProvider

    [reloadOnSearch=true] - {boolean=} - reload route when only $location.search() or $location.hash() changes.

    Setting this to false did the trick without all of the above for me.

提交回复
热议问题