1
I have a login screen, with the total "/Authentication/login".
How to do at the angle when the user enters the system, it goes straight to this route ?
After logging in if it enters this route, it always validates and if the user has logged in it goes to the route "/" ?
Route
import { Routes } from '@angular/router';
import { FullComponent } from './layouts/full/full.component';
import { AppBlankComponent } from './layouts/blank/blank.component';
export const AppRoutes: Routes =
[
{
path: '',
component: FullComponent,
children:
[
{
path: '',
loadChildren: './dashboards/dashboards.module#DashboardsModule'
/*pathMatch: 'full',
redirectTo: '/dashboards/dashboard1', */
},
{
path: 'configuracao',
loadChildren: './paginas/configuracao/configuracao.module#ConfiguracaoModule'
},
{
path: 'arquivo',
loadChildren: './paginas/arquivo/arquivo.module#ArquivoModule'
},
{
path: 'declaracao',
loadChildren: './paginas/declaracao/declaracao.module#DeclaracaoModule'
},
{
path: 'parametro',
loadChildren: './paginas/parametro/parametro.module#ParametroModule'
},
{
path: 'endereco',
loadChildren: './paginas/endereco/endereco.module#EnderecoModule'
},
{
path: 'contribuinte',
loadChildren: './paginas/banco/banco.module#BancoModule'
},
{
path: 'dashboard',
loadChildren: './dashboards/dashboards.module#DashboardsModule'
}
]
},
{
path: '',
component: AppBlankComponent,
children:
[
{
path: 'authentication',
loadChildren: './authentication/authentication.module#AuthenticationModule'
}
]
},
{
path: '**',
redirectTo: '404'
}
];
Angular version: 5.0.0
which version of
angular
? Can your route code?– Ricardo Pontual
Included in the main question
– Guilherme
When defining
path: ''
this means it will be your default route. Why not add your component to the default route?– Marconi
So I was handed the project this way. What would be the difference ? In this project I’m working on, there are routes and subroutes. Each subroute is called in its module.
– Guilherme