普华永道(PwC) 长期招聘各种软件开发,管理岗位,可全年在家办公, 全年假期优厚。有意者可邮件联系 julia_faneast@163.com 职位简介

Angular中获取路由信息

constructor (
  private router: Router,
) {this.urlChangeSubscriptions = router.events.subscribe((param) => {
      if (param instanceof NavigationEnd) {
        const urls = param.url.split('/');
        if (this.isDealsProject) {
          this.currentTab = urls[3] || '';
        } else {
          this.currentTab = urls[2] || '';
        }
      }
    });
}

 

posted @ 2019-08-20 16:55  julia_faneast  阅读(3184)  评论(0编辑  收藏  举报