/
parkovki
/
frontend
Обзор
Документация
Войти
/
parkovki
/
frontend
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
main
src/app/app.component.ts
54 строки
2 KB
Ivan
feat: implement core application features, including listing management, search, booking, chat, and admin modules with supporting services and UI components.
12 авг 2026, 18:29
12 авг 2026, 18:29
a708cf9
Код
Авторство
О чём код?
import { Component, inject } from '@angular/core'; import { RouterOutlet, Router, NavigationEnd } from '@angular/router'; import { AuthDialogService } from './core/auth/auth-dialog.service'; import { HeaderComponent } from './shared/layout/header/header.component'; import { FooterComponent } from './shared/layout/footer/footer.component'; import { AuthDialogComponent } from './features/auth/ui/auth-dialog/auth-dialog.component'; import { ConfirmDialogComponent } from './shared/ui/confirm-dialog/confirm-dialog.component'; import { FeedbackToastComponent } from './shared/ui/feedback-toast/feedback-toast.component'; import { MobileBottomNavComponent } from './shared/layout/mobile-bottom-nav/mobile-bottom-nav.component'; import { toSignal } from '@angular/core/rxjs-interop'; import { filter, map } from 'rxjs/operators'; @Component({ selector: 'app-root', imports: [ RouterOutlet, HeaderComponent, FooterComponent, AuthDialogComponent, ConfirmDialogComponent, FeedbackToastComponent, MobileBottomNavComponent, ], templateUrl: './app.component.html', styleUrl: './app.component.scss', }) export class AppComponent { readonly authDialog = inject(AuthDialogService); readonly #router = inject(Router); readonly isChatsPage = toSignal( this.#router.events.pipe( filter((event): event is NavigationEnd => event instanceof NavigationEnd), map((event) => event.urlAfterRedirects.startsWith('/chats')), ), { initialValue: this.#router.url.startsWith('/chats') }, ); readonly isChatDetailPage = toSignal( this.#router.events.pipe( filter((event): event is NavigationEnd => event instanceof NavigationEnd), map((event) => { const url = event.urlAfterRedirects.split('?')[0] ?? ''; return url.startsWith('/chats/') && url.length > 7; }), ), { initialValue: (() => { const url = this.#router.url.split('?')[0] ?? ''; return url.startsWith('/chats/') && url.length > 7; })(), }, ); }