I have a problem with routes in angular 8, the problem is the routes in children its not working
my routes are:
const routes: Routes = [
{
path: 'admin', component: MainComponent, children: [
{ path: 'uno', component: HomeComponent, outlet: 'sub' },
{ path: '', component: HomeComponent, outlet: 'sub' },
//{ path: '', component: HomeComponent, outlet: 'sub' },
]
}
];
The url localhost:5001/admin is working the components "MainComponent" and "HomeComponent" show in the browser, but the url localhost:5001/admin/uno no, in the console i have a messege " Error: Cannot match any routes. URL Segment: 'admin/uno'"
Thanks in advance
** update **
I have this in the app.component.html
<router-outlet></router-outlet>
And in the main.component.html
<div id="content" class="content">
<div>
<button routerLink="uno">Tab1</button>
</div>
<router-outlet name="sub"></router-outlet>
</div>
outletis set to'sub'?