fix(news-details): change navigation to always go back to news list
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
ViewChild,
|
||||
inject,
|
||||
} from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
@@ -66,7 +65,6 @@ export class NewsDetailComponent implements OnInit {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly httpClient = inject(HttpClient);
|
||||
private readonly worksService = inject(WorksService);
|
||||
private readonly location = inject(Location);
|
||||
private readonly sanitizer = inject(DomSanitizer);
|
||||
|
||||
article: NewsArticleDetail | null = null;
|
||||
@@ -150,7 +148,7 @@ export class NewsDetailComponent implements OnInit {
|
||||
}
|
||||
|
||||
navigateBack(): void {
|
||||
this.location.back();
|
||||
this.router.navigate(['/news']);
|
||||
}
|
||||
|
||||
formatDate(dateStr?: string | null): string {
|
||||
|
||||
Reference in New Issue
Block a user