Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to navigate from one page to another in angular

import { 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
    }

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #navigate #page #angular
ADD COMMENT
Topic
Name
3+4 =