Fix routing when notfound

This commit is contained in:
pakintada@gmail.com 2024-02-08 11:26:16 +07:00
parent f38f894dce
commit 9ccea7f635
7 changed files with 152 additions and 52 deletions

View file

@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-notfound',
@ -6,5 +7,14 @@ import { Component } from '@angular/core';
template: `<h1>Not Found!!!</h1>`
})
export class NotfoundComponent {
constructor(private router: Router) {
// do set country and filename
console.log('not found');
this.router.navigate(['/departments']).then(
() => {
console.log('redirected');
window.location.reload();
}
);
}
}