重新加载当前路线,但扩展面板可能无法在Angular 4中使用

时间:2018-11-23 01:22:20

标签: angular

我有一个带有扩展面板的sideMenu,包含带有按钮的md-list,以导航到其他路由器。

我将其应用为允许我通过重新点击按钮来重新加载当前路线

    this.router.routeReuseStrategy.shouldReuseRoute = function(){
    return false;
};

this.router.events.subscribe((evt) => {
    if (evt instanceof NavigationEnd) {
        this.router.navigated = false;
        window.scrollTo(0, 0);
    }
});

但是,单击按钮后,扩展面板并没有保持展开状态。

感谢您的帮助。

0 个答案:

没有答案