Jump method: _ this represents the component instance
_this.router.navigate(["/analysis/examdetail"],
{
queryParams: _this.params
});
in the new route:
constructor(private route: ActivatedRoute, private mrequest: MrequestService, public changeDetectorRef: ChangeDetectorRef) {
this.route.queryParams.subscribe(params => {
console.log(params);
this.e_id = params.e_id;
this.p_id = params.p_id;
this.endtype = params.endtype;
});
this.isIOS = mrequest.isIOSPlatform();
console.log(this.endtype);
this.getExamDetail();
}
ngOnInit() {
console.log(2222);
}
The jump on the page is done by clicking on the echarts bar chart
this.echartsIntance.on("click", function(params) {
// console.log(params);
const dataIndex = params.dataIndex;
// console.log(_this.examId);
_this.params["e_id"] = _this.examId[dataIndex];
_this.params["p_id"] = _this.paperId[dataIndex];
_this.params.cid = _this.classIdList[dataIndex];
// console.log(_this.params);
_this.router.navigate(["/analysis/examdetail"],
{
queryParams: _this.params
});
});
is it suspected that the jump angular2 in echarts cannot be detected? Is there any solution? The code in the
constructor can be executed, but the data in it cannot be rendered to the page, and the console cannot print the information in the ngoninit.