Search
 
SCRIPT & CODE EXAMPLE
 

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
    }

}
Comment

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
    }

}
Comment

how to navigate from one page to another in angular

<button class="btn btn-primary" (click)="gotoHome()">Home</button>
Comment

how to navigate from one page to another in angular

const routes: Routes = [
  { path:'', component:LoginComponent},
  { path: 'home', component:HomeComponent },  // you must add your component here
  { path: '**', component:PageNotFoundComponent }
];
Comment

PREVIOUS NEXT
Code Example
Typescript :: typescript how to check if string is a date 
Typescript :: how to select last 2 elements in a string python 
Typescript :: upgrade requests version 
Typescript :: add column if not exists postgresql 
Typescript :: typescript iterate over enum 
Typescript :: define a ref typescript 
Typescript :: sort array by date typescript 
Typescript :: python requests header allow redirect false 
Typescript :: subplots legend 
Typescript :: weakly connected components in graph 
Typescript :: typescript filter undefined 
Typescript :: styled components reset 
Typescript :: check if column exists in dataframe 
Typescript :: serenity Criteria typescript 
Typescript :: typescript style type 
Typescript :: Warning: initial exceeded maximum budget. angular 
Typescript :: vscode custom snippets multiple transform 
Typescript :: div contenteditable maxlength reactjs 
Typescript :: typescript create guid 
Typescript :: print consonants python 
Typescript :: ion slides updateAutoHeight 
Typescript :: adding headers to httpclient angular 
Typescript :: hthe cmd to create tsconfig.json 
Typescript :: voting results 2020 live 
Typescript :: symfony assets install 
Typescript :: how to get index for ngfor 
Typescript :: typescript if then shorthand 
Typescript :: define array in typescript react useState 
Typescript :: get last item from array ts 
Typescript :: lifecycle components android dependency 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =