fix DI errors and stabilize static page navigation
This commit is contained in:
@@ -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