angular url is adding unwanted characters

前端 未结 3 1951
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-06 05:26

I had a project where the URL just worked fine when working locally by going to

localhost:9000/

the URL would become

3条回答
  •  粉色の甜心
    2021-01-06 06:16

    This is actually not a bug.

    See commit-aa077e8

    The default hash-prefix used for $location hash-bang URLs has changed from the empty string ('') to the bang ('!').

    If you actually want to have no hash-prefix, then you can restore the previous behavior by adding a configuration block to your application:

    appModule.config(['$locationProvider', function($locationProvider) {
      $locationProvider.hashPrefix('');
    }]);
    

提交回复
热议问题