0
my link to list the simplement client does not work , wanted to know why WHAT I WOULD HAVE TO DO TO CALL THE ROUTE /list customers and not customers/list customers
1 - Clienteroutingmodule 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>
Now I understood the thing of this budega... it happens that ' ' empty route I’m calling the cadastral and not the list...
– Paulo Ceami