Angular JS Change Route Programmatically
Category:
Sometimes we'll want to dynamically change the route in Angular during some custom code execution. Here's how we can do it:
$location.path('/foo');
If your call to $location takes place in an async success callback (i.e. after making a POST request to a server), you may also have to reload the route:
$route.reload();