Angular'da Yönlendirmede Yönlendirme
Angular'da, rotaları farklı bir yola yönlendirebilirsiniz.
Bu, isteğin yönlendirilmesi gereken URL'nin belirtildiği
redirectTo anahtarı kullanılarak yapılır.
Örnek olarak, istenen rota bulunamazsa, onu ana sayfaya yönlendirelim:
const appRoutes: Routes =[
{ path: '', component: HomeComponent},
{ path: 'aaaa', component: AaaaComponent},
{ path: '**', redirectTo: '/'}
];
/bbbb/ URL'sini
/aaaa/ adresine yönlendirin:
const appRoutes: Routes =[
{ path: 'aaaa', component: AaaaComponent},
{ path: 'bbbb', component: BbbbComponent},
];