0

hello there I have 2 routing module app.routing and account.routing I am trying to get the title from the route but is not working for the route under account.routing

  { path: 'mypath', loadChildren: () => import('./sap/sap.module').then(mod => mod.SApModule), data: { breadcrumb: 'SaP', title: 'TITLEs' } },

  const appTitle = this.titleService.getTitle();
  this.router
    .events.pipe(
      filter(event => event instanceof NavigationEnd),
      map(() => {
        const child = this.activatedRoute.firstChild;
        if (child.snapshot.data['title']) {
          return child.snapshot.data['title'];
        }
        return appTitle;
      })
    ).subscribe((ttl: string) => {
      this.titleService.setTitle(ttl);
    });
hiolk ygj
  • 1
  • 1

0 Answers0