当我调用click事件时,我无法重新加载组件。我尝试了以下代码
(dealCode,periodName) => {
let url:any='/valuation;dealcode=J9PPR;fundPeriod=2019Q3;useDefault=true';
this.router.navigateByUrl('/dummy', { skipLocationChange: true });
setTimeout(() =>this.router.navigate([url]));
}
答案 0 :(得分:0)
Angular正在执行url编码,您必须告诉他信任您
import { DomSanitizer } from '@angular/platform-browser';
constructor(
private _sanitzer: DomSanitizer
) { }
您的功能
(dealCode,periodName) => {
let url:any='/valuation;dealcode=J9PPR;fundPeriod=2019Q3;useDefault=true';
this.router.navigateByUrl('/dummy', { skipLocationChange: true });
const safeUrl = this._sanitzer.bypassSecurityTrustUrl(url);
setTimeout(() =>this.router.navigate([safeUrl]));
}