Having trouble creating a redirection call in the controller with a numerical parameter. Here is the code I've been using:
$location.path('/tasklist/:$rootScope.job_id');
I have also attempted the following:
$location.path("/tasklist/",$rootScope.job_id');
This is how my route is set up:
$routeProvider.when('/tasklist/:job_id', {templateUrl: 'partials/list-task.html', controller: 'tasklistCtrl'});
The route works perfectly fine in my HTML with this code:
<a ng-click="go('/tasklist/' + job.id)">back to task list</a>
I am looking to implement automatic redirection in the controller using $location.path()
or any other method. Any help would be greatly appreciated!