嗨,伙计们,不知道你们能不能给我点建议?我目前正在尝试获取一个URL并动态显示一个函数。
this._mont.showMap(+this._route.snapshot.params['id']));每当我使用这行代码时,showMap()函数就会在当前索引上被捕获。我想使用NagivationEnd路由器事件来获取下一个索引。
this.router.events.filter((routerEvent) => routerEvent instanceof NavigationEnd)
.subscribe(() => this._mont.showMap(+this._route.snapshot.params['id']));
}我想知道我这样做是否正确,或者有没有更好的方法来处理它?
https://stackoverflow.com/questions/51285193
复制相似问题