在向网站添加新组件后,为什么我的网站仍然无法加载?

时间:2019-05-09 14:34:55

标签: html angular ngx-admin

几周以来,我已经开始使用ngx-admin作为网站管理员的仪表板。

我以为我会围绕它建立我的整个网站,所以我在src / app文件夹中添加了主页组件,并将其添加到了app-routing模块中,但是当我尝试运行它时,它就卡住了在加载屏幕中。为什么会这样?

这是我的应用程序路由模块:

import { ExtraOptions, RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import {
NbAuthComponent,
NbLoginComponent,
NbLogoutComponent,
NbRegisterComponent,
NbRequestPasswordComponent,
NbResetPasswordComponent,
} from '@nebular/auth';
import { AuthGuard } from './auth-guard.service';
import { HomepageComponent } from './homepage/homepage.component';

const routes: Routes = [
{path: 'home', component: HomepageComponent},
{ path: 'users', loadChildren: 'app/pages/pages.module#PagesModule', canActivate: [AuthGuard]},
{
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: '**', pathMatch: 'full', redirectTo: 'users'},
];

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

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

0 个答案:

没有答案