. Advertisement .
..3..
. Advertisement .
..4..
I want to navigate from one page to another in angular but I am still a novice at Typescript, your suggestions would be much appreciated. Thank you.
Here is a suggestion for youimport { Router } from '@angular/router';
export class YourComponentClassName implements OnInit {
constructor(private router: Router) {}
gotoHome(){
this.router.navigate(['/home']); // define your component where you want to go
}
}
I’ve tried some solutions but the simple method should be:
Using the solution like this