Can I reclaim control of the URL hash-fragment from AngularJS?

前端 未结 1 1025
南旧
南旧 2021-01-04 03:18

I\'m using AngularJS, and would like to process a given #hash-fragment in the address-bar. However, —and this is key— I\'ll not be using the hash-fragm

相关标签:
1条回答
  • 2021-01-04 03:33

    # seems to work well enough on the angular api docs page. So with a little snooping and testing I found that

    app.config(function($locationProvider) {
        $locationProvider.html5Mode(true).hashPrefix('!');
    });
    

    makes the difference.

    0 讨论(0)
提交回复
热议问题