1
我正在使用Angular2(RC2)和新的路由器(Alpaha.8)如何停止显示在URL中的查询参数,如果它是未定义的?例如。如何在角度2中隐藏空的或未定义的查询参数?
this.router.navigate(["/results", this.month, this.day],
{
queryParams: {
adults: +this.adults
}
});
有时候大人可能有价值,有时候可能不是我不想展示的时候。
我加 '让queryParams:任何= {};' – MattDaniell