Angular Simple Routing

 

app.routing.module.ts


onst routes: Routes = [{

  component:HomeComponent,
  path:'home'
},
{
  component:UserComponent,
  path:'user'
},
{
  component:UserComponent,
  path:'about'
}




app.component.html


<a routerLink=" ">Home</a><br>
<a routerLink="about">About</a><br>
<a routerLink="user">User</a><br>


<router-outlet></router-outlet>

Comments

Popular posts from this blog

Primary/Main features of Java

HTTrack ऑफलाइन वेबसाइट डाउनलोडर क्या है ?

Which language is used for Java?