lundi 23 mars 2020

Router not working When i need to open another page

I have an angular app that i need to root to next page by opening it in a new tab with

<button class="button"> <a target="_blank" routerLink="/goToNext" 
           routerLinkActive="active current" > items 
</a></button>

I configured the component here in app.moduls.ts

const appRoutes: Routes = [ 
   { path: 'goToNext', component: NextComponent },
]

RouterModule.forRoot(
  appRoutes,
  { enableTracing: true } 
)

But current when i click the button browser link changes and the next component is not shown it's like a reload of the main site page only ???

Aucun commentaire:

Enregistrer un commentaire