AngularJS: How to clear query parameters in the URL?

后端 未结 16 2610
余生分开走
余生分开走 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

    You can delete a specific query parameter by using:

    delete $location.$$search.nameOfParameter;
    

    Or you can clear all the query params by setting search to an empty object:

    $location.$$search = {};
    

提交回复
热议问题