I have a function which redirects to another page, I want that after redirection the redirected page also reloads.
I want to reload the login page after being redirected to it. using 'window.location.reload()' reloads the current page which is home page but not the login page. How to reload a specefic 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']);
}
}