AngularJS: How to clear query parameters in the URL?

后端 未结 16 2633
余生分开走
余生分开走 2020-12-04 14:40

My AngularJS application needs to have access to the user\'s LinkedIn profile. In order to do that I need to redirect the user to a LinkedIn URL which contains a callback re

16条回答
  •  一向
    一向 (楼主)
    2020-12-04 15:42

    To remove ALL query parameters, do:

    $location.search({});
    

    To remove ONE particular query parameter, do:

    $location.search('myQueryParam', null);
    

提交回复
热议问题