Cześć. Mam taki problem kiedy jestem na stronie Lista użytkowników i ją odświeżę przenosi mnie na stronę główną. Strona jest napisana w angularze na frontendzie oraz .net corze na backendzie.
mój app.routing module wygląda tak:
import { NgModule } from '@angular/core';
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { LoginPageComponent } from './modules/login/containers/login-page/login-page.component';
import { RemindPasswordPageComponent } from './modules/login/containers/remind-password-page/remind-password-page.component';
import { NewPasswordPageComponent } from './modules/login/containers/new-password-page/new-password-page.component';
import { ChangePasswordPageComponent } from './modules/login/containers/change-password-page/change-password-page.component';
import { AuthGuard } from './auth.guard';
const routes: Routes = [
{
path: '',
loadChildren: './modules/dashboard/dashboard.module#DashboardModule',
canActivate: [AuthGuard]
},
{
path: 'users',
loadChildren: './modules/user/user.module#UserModule',
canActivate: [AuthGuard]
},
{
path: 'settings',
loadChildren: './modules/settings/settings.module#SettingsModule',
canActivate: [AuthGuard]
},
{
path: 'login',
component: LoginPageComponent
},
{
path: 'remind-password',
component: RemindPasswordPageComponent
},
{
path: 'new-password',
component: NewPasswordPageComponent
},
{
path: 'change-password',
component: ChangePasswordPageComponent
},
{
path: '**',
redirectTo: ''
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules, useHash: true })],
exports: [RouterModule]
})
export class AppRoutingModule { }