I have 2 components. 1 is the registration component, 2 is the main component. And before the main component, I need to open the register component. That is, a person visits the site link, and the register component opens for him. After registration, the main component opens.
RouterModule.forRoot ([
{ path: '', redirectTo: 'registration', pathMatch: 'full' },
{ path: 'registration', component: RegisterComponent }
])