Is there any way to navigate from the App component to another component without using router-outlet
in app.component.html
?I have a button in app.component.html.when the user clicks user should go to checkout.compoent.html
.
Router config
const routes: Routes = [
{
path: '',
component: AppComponent,
},
{
path: 'checkout',
component: CreditCardFormComponent,
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
question from:
https://stackoverflow.com/questions/65951432/go-to-another-component-from-app-component-angular 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…