My link to list the client does not work, I wanted to know the WHY WHAT WOULD I HAVE TO DO TO CALL THE ROUTE / list clients and not customers / clients list
1 - ClientRoutingModule 2 - AppRoutingModule 3- routerlink
import { LoginGuard } from './login/login.guard';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { LoginComponent } from './login/login.component';
const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'clientes', loadChildren: 'app/clientes/cliente.module#ClienteModule' },
// { path: '**', component: PageNotFoundComponent }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
import { ClientesPedidosComponent } from './clientes-pedidos/clientes-pedidos.component';
import { LoginGuard } from './../login/login.guard';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ClientesListaComponent } from './clientes-lista/clientes-lista.component';
import { ClientesComponent } from './clientes.component';
const routes: Routes = [
{
//path: 'clientes' using lazyloading,
path: '',
component: ClientesComponent,
children: [
{ path: 'listaclientes', component: ClientesListaComponent },
{ path: 'lista-pedidos', component: ClientesPedidosComponent },
{ path: ':id', component: ClientesComponent, canActivate: [LoginGuard] }
]
},
];
@NgModule({
imports: [
RouterModule.forChild(routes)
],
exports: [
RouterModule
]
})
export class ClienteRoutingModule { }
<li><a routerLink="/listaclientes"><i class="fa fa-files-o"></i>Lista de Clientes</a></li>