feat(spa): scaffold Angular app shell with host/player routes
This commit is contained in:
20
frontend/angular/src/app/app.component.ts
Normal file
20
frontend/angular/src/app/app.component.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { Router, RouterLink, RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
standalone: true,
|
||||
imports: [RouterOutlet, RouterLink],
|
||||
templateUrl: './app.component.html',
|
||||
styleUrl: './app.component.css',
|
||||
})
|
||||
export class AppComponent {
|
||||
private readonly router = inject(Router);
|
||||
|
||||
constructor() {
|
||||
const shellRoute = document.body.dataset['wppShellRoute'];
|
||||
if (shellRoute === '/host' || shellRoute === '/player') {
|
||||
void this.router.navigateByUrl(shellRoute);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user