add pageTitle input
This commit is contained in:
parent
090d37ed54
commit
a2efff82b9
|
@ -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",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<auth-anon-layout>
|
||||
<!-- <div *ngIf="routeData$ | async as routeData"> -->
|
||||
<auth-anon-layout [title]="pageTitle">
|
||||
<router-outlet></router-outlet>
|
||||
<router-outlet slot="secondary" name="secondary"></router-outlet>
|
||||
</auth-anon-layout>
|
||||
<!-- </div> -->
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue