In one page, we have a link on click of which we make a route change.
<td>
<a class="btn" ng-link="['ResourceList', {job_id: vm.job.job_id, resource_id: instance.id}]">See Tasks</a>
</td>
And the route is defined as in our app.js:
$routeConfig: [
.....
.....
{ path: "/app/task-list/:job_id/:resource_id", component: "resourcelist", name: "ResourceList" },
Now in the component's $routerOnActivate
we read the $routeParams
.
vm.$routerOnActivate = function (next, previous) {
vm.job_id = next.params.job_id;
vm.resource_id = next.params.resource_id;
displayList(true);
But the $routerOnActivate
is called twice.
Hence, displayList()
is called twice. What am I doing wrong?