fix DI errors and stabilize static page navigation
This commit is contained in:
@@ -31,10 +31,10 @@ export class CategoryComponent implements OnInit, OnDestroy {
|
||||
private isLoadingMore = false;
|
||||
private routeSubscription?: Subscription;
|
||||
private scrollTimeout?: ReturnType<typeof setTimeout>;
|
||||
private readonly productFacade = inject(ProductFacade);
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private productFacade: ProductFacade,
|
||||
private cartService: CartService,
|
||||
private prefetchService: PrefetchService
|
||||
) {}
|
||||
|
||||
@@ -27,6 +27,7 @@ export class SubcategoriesComponent implements OnInit, OnDestroy {
|
||||
error = signal<string | null>(null);
|
||||
|
||||
private i18n = inject(TranslateService);
|
||||
private readonly productFacade = inject(ProductFacade);
|
||||
parentName = signal<string>('');
|
||||
|
||||
private routeSubscription?: Subscription;
|
||||
@@ -35,7 +36,6 @@ export class SubcategoriesComponent implements OnInit, OnDestroy {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private categoryFacade: CategoryFacade,
|
||||
private productFacade: ProductFacade,
|
||||
private langService: LanguageService,
|
||||
private cartService: CartService
|
||||
) {}
|
||||
|
||||
@@ -107,11 +107,11 @@ export class ItemDetailComponent implements OnInit, OnDestroy {
|
||||
private seoService = inject(SeoService);
|
||||
private i18n = inject(TranslateService);
|
||||
private authService = inject(AuthService);
|
||||
private readonly productFacade = inject(ProductFacade);
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private apiService: ApiService,
|
||||
private productFacade: ProductFacade,
|
||||
private cartService: CartService,
|
||||
private telegramService: TelegramService,
|
||||
private sanitizer: DomSanitizer,
|
||||
|
||||
@@ -35,9 +35,9 @@ export class SearchComponent implements OnDestroy {
|
||||
private searchSubject = new Subject<string>();
|
||||
private searchSubscription: Subscription;
|
||||
private i18n = inject(TranslateService);
|
||||
private readonly productFacade = inject(ProductFacade);
|
||||
|
||||
constructor(
|
||||
private productFacade: ProductFacade,
|
||||
private cartService: CartService,
|
||||
private prefetchService: PrefetchService
|
||||
) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<section class="static-page__state">
|
||||
<h1>404</h1>
|
||||
<p>Страница не найдена</p>
|
||||
<a [routerLink]="'/' | langRoute">На главную</a>
|
||||
<a [routerLink]="homeRoute()">На главную</a>
|
||||
</section>
|
||||
} @else {
|
||||
<article class="static-page__content">
|
||||
|
||||
@@ -5,12 +5,11 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
import { StaticPageResolverService } from '../../core/config/static-page-resolver.service';
|
||||
import { LanguageService } from '../../services/language.service';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-static-page',
|
||||
standalone: true,
|
||||
imports: [CommonModule, RouterLink, TranslatePipe, LangRoutePipe],
|
||||
imports: [CommonModule, RouterLink, TranslatePipe],
|
||||
templateUrl: './static-page.component.html',
|
||||
styleUrls: ['./static-page.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
@@ -24,9 +23,12 @@ export class StaticPageComponent {
|
||||
readonly loading = signal(true);
|
||||
readonly notFound = signal(false);
|
||||
readonly title = signal('');
|
||||
readonly homeRoute = signal('');
|
||||
readonly safeHtml = signal<SafeHtml>(this.sanitizer.bypassSecurityTrustHtml(''));
|
||||
|
||||
constructor() {
|
||||
this.homeRoute.set(`/${this.languageService.currentLanguage()}`);
|
||||
|
||||
this.route.paramMap.subscribe(params => {
|
||||
const keyFromParam = params.get('key');
|
||||
const staticPath = params.get('staticPath');
|
||||
|
||||
Reference in New Issue
Block a user