Ngx-admin: Removed # from URL but Pages sub menu does't work.

Created on 4 Jul 2018  路  2Comments  路  Source: akveo/ngx-admin

Ex: http://localhost:4200/pages/ui-features/grid
Its Loading loading, but wont working. my code is follows,

app-routing.module.ts

default

import { ExtraOptions, RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import {
NbAuthComponent,
NbLoginComponent,
NbLogoutComponent,
NbRegisterComponent,
NbRequestPasswordComponent,
NbResetPasswordComponent,
} from '@nebular/auth';

const routes: Routes = [
{ path: 'pages', loadChildren: 'app/pages/pages.module#PagesModule' },
{
path: 'auth',
component: NbAuthComponent,
children: [
{
path: '',
component: NbLoginComponent,
},
{
path: 'login',
component: NbLoginComponent,
},
{
path: 'register',
component: NbRegisterComponent,
},
{
path: 'logout',
component: NbLogoutComponent,
},
{
path: 'request-password',
component: NbRequestPasswordComponent,
},
{
path: 'reset-password',
component: NbResetPasswordComponent,
},
],
},
{ path: '', redirectTo: 'pages', pathMatch: 'full' },
{ path: '**', redirectTo: 'pages' },
];

//const config: ExtraOptions = {
// useHash: true,
//};

@NgModule({
// imports: [RouterModule.forRoot(routes, config)],
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {
}

//export const routing = RouterModule.forRoot(routes, { useHash: false });

question

Most helpful comment

try adding <base href='/'> to your index.html in the <head> section

All 2 comments

try adding <base href='/'> to your index.html in the <head> section

You should close this ticket as well, as it looks like you posted your question here as well https://github.com/akveo/ngx-admin/issues/1173 and received an answer there as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pulfabio picture pulfabio  路  4Comments

yanyim picture yanyim  路  3Comments

tal-shahar picture tal-shahar  路  3Comments

nfdavenport picture nfdavenport  路  3Comments

PatrickHuetter picture PatrickHuetter  路  3Comments