2👍
✅
You need to return the promise from the activate
method:
activate(params, routeConfig) {
return this.chartService.getChart(params.task)
.then(response => this.resetLineData(response));
}
By returning the promise from the router lifecycle callback, the Router will wait for the promise to resolve before moving on with the lifecycle of the page.
Source:stackexchange.com