From a2efff82b9892be575c3e14e42443fe18167ecc0 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:18:16 -0700 Subject: [PATCH] add pageTitle input --- apps/web/src/app/oss-routing.module.ts | 20 +++++++++++++------ .../anon-layout-wrapper.component.html | 4 +++- .../anon-layout-wrapper.component.ts | 8 +++++++- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/apps/web/src/app/oss-routing.module.ts b/apps/web/src/app/oss-routing.module.ts index 181f0904f4..8de24c2376 100644 --- a/apps/web/src/app/oss-routing.module.ts +++ b/apps/web/src/app/oss-routing.module.ts @@ -197,12 +197,20 @@ const routes: Routes = [ children: [ { path: "sample-route", - component: LoginComponent, // replace with your component - }, - { - path: "", - component: HintComponent, // just an example that shows secondary content. Replace with your component (or remove this secondary outlet entirely if not needed) - outlet: "secondary", + children: [ + { + path: "", + component: LoginComponent, // replace with your component + }, + { + path: "", + component: HintComponent, // just an example that shows secondary content. Replace with your component (or remove this secondary outlet entirely if not needed) + outlet: "secondary", + }, + ], + data: { + pageTitle: "The Page Title", + }, }, ], }, diff --git a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.html b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.html index ad58cea82f..1d89694d8d 100644 --- a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.html +++ b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.html @@ -1,4 +1,6 @@ - + + + diff --git a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts index 0c82cd28a1..f61cbdf9ac 100644 --- a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts +++ b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts @@ -1,5 +1,5 @@ import { Component, OnDestroy, OnInit } from "@angular/core"; -import { RouterModule } from "@angular/router"; +import { ActivatedRoute, RouterModule } from "@angular/router"; import { AnonLayoutComponent } from "./anon-layout.component"; @@ -9,6 +9,12 @@ import { AnonLayoutComponent } from "./anon-layout.component"; imports: [AnonLayoutComponent, RouterModule], }) export class AnonLayoutWrapperComponent implements OnInit, OnDestroy { + pageTitle: string; + + constructor(private route: ActivatedRoute) { + this.pageTitle = this.route.snapshot.firstChild.data["pageTitle"]; + } + async ngOnInit() { document.body.classList.add("layout_frontend"); }