angular获取当前路由信息

 children: [
      {
        path: '',
        redirectTo: 'houseManage',
        pathMatch: 'full'
      },
      {
        path: 'houseManage',
        data: {
          title: '楼盘管理'
        },
        loadChildren: () =>
          import('./houseManage/houseManage.module').then(
            m => m.HouseManageModule
          )
      },
      {
        path: 'operateManage',
        data: {
          title: '运营方管理'
        },
        loadChildren: './operateManage/operateManage.module#OperateManageModule'
      },

import { ActivatedRoute, Router } from '@angular/router';
想要获取当前路由地址path :
this.router.url
想要获取当前路由的title:
this.activatedRoute.data.subscribe(res => console.log(res));

const data = this.activatedRoute.snapshot.data;

你可能感兴趣的:(angular)