I'm trying to implement a simple example of nested/child routes in an Angular Ionic v5 app, using Angular's routing guide. I created a project using ionic start and selected the blank template, then created two components ChildAComponent and ChildBComponent. Here's the relevant code snippet from home.page.html:
<div id="container">
<strong>Ready to create an app?</strong>
<p>Start with Ionic <a target="_blank" rel="noopener noreferrer"
href="https://ionicframework.com/docs/components">UI Components</a></p>
<div id="stuff">
<a routerLink="child-a">Child A</a><br>
<a routerLink="child-b">Child B</a><br>
<a routerLink="404">404</a>
</div>
<div id="thing">
<router-outlet></router-outlet>
</div>
</div>
I'm trying to use the a tags to drive what component renders in the router-outlet. When I first load the page (URL: /home) I can click one of the links and the appropriate child element renders in the outlet. When this happens, though, the hrefs on the a tags (which I'm assuming are put there by Angular based on the routerLinks) all change to the navigated-to URL.
As such, I can't click on the other component link to render that component without reloading the page (going back to /home).
Before clicking a link (URL is /home):
After clicking Child A link (URL is /home/childa):
The Angular docs don't seem to indicate I've configured anything incorrectly, and I can't see anything glaringly different in my code compared to the routing in the heroes example. What am I doing wrong?
Here's my home-routing.module.ts if it helps:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomePage } from './home.page';
import { ChildAComponent } from './childa/childa.component';
import { ChildBComponent } from './childb/childb.component';
const routes: Routes = [
{
path: '',
component: HomePage,
children: [
{
path: 'child-a',
component: ChildAComponent,
},
{
path: 'child-b',
component: ChildBComponent,
},
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class HomePageRoutingModule {}

