add pages
This commit is contained in:
+22
-5
@@ -1,12 +1,29 @@
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { Component, computed, inject } from '@angular/core';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { NavigationEnd, Router, RouterOutlet } from '@angular/router';
|
||||
import { filter, map, startWith } from 'rxjs';
|
||||
|
||||
import { BottomNav } from './layout/bottom-nav/bottom-nav';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet],
|
||||
imports: [RouterOutlet, BottomNav],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss'
|
||||
styleUrl: './app.scss',
|
||||
})
|
||||
export class App {
|
||||
protected readonly title = signal('maps');
|
||||
private readonly router = inject(Router);
|
||||
|
||||
private readonly url = toSignal(
|
||||
this.router.events.pipe(
|
||||
filter((event): event is NavigationEnd => event instanceof NavigationEnd),
|
||||
map(() => this.router.url),
|
||||
startWith(this.router.url),
|
||||
),
|
||||
{ initialValue: this.router.url },
|
||||
);
|
||||
|
||||
protected readonly hideNav = computed(
|
||||
() => this.url().startsWith('/items') || this.url().startsWith('/objects'),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user