Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to route to another page 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: #route #page #angular
ADD COMMENT
Topic
Name
6+2 =