How to use Querystring with $location.path() in AngularJS

后端 未结 2 799
误落风尘
误落风尘 2021-01-01 14:52

I want to redirect user to another page after successful login using query string. If I copy & paste to browser\'s address bar http://example.com/#/login?ref=/path

2条回答
  •  臣服心动
    2021-01-01 15:27

    I had the same problem.

    I want to change path and search the same time.

    It is possible by doing this:

    $location.$$search ={foo:'bar', buz:'buz'}
    $location.$$path = '/some/path'
    $location.$$compose()
    

    It is not documented and it could broke at any new angular version.

提交回复
热议问题