How to redirect to another page using AngularJS?

前端 未结 12 685
深忆病人
深忆病人 2020-11-27 11:04

I am using ajax call to perform functionality in a service file and if the response is successful, I want to redirect the page to another url. Currently, I am doing this by

12条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 11:38

    I used the below code to redirect to new page

    $window.location.href = '/foldername/page.html';
    

    and injected $window object in my controller function.

提交回复
热议问题