navigate from one component to another in angular code example
Example 1: how to navigate from one page to another in angular
<button class="btn btn-primary" (click)="gotoHome()">Home</button>
Example 2: 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 }
];