I am working on a function that redirects to another page, and I am looking to have the redirected page reload once the redirection is complete.
I specifically need the login page to reload after being redirected to it. The usual 'window.location.reload()' only reloads the current page, which is the home page, not the login page. How can I reload a specific page?
homeComponent.ts
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { FormGroup, FormBuilder, FormControl, Validators, Form } from '@angular/forms';
import { LoginComponent } from '../authentification/login/login.component';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
ngOnInit(): void {
}
constructor(private router: Router) { }
redirection(){
this.router.navigate(['/login']);
}
}