该网站可在 Chrome 和 Firefox 中运行。在 Safari 中,您可以导航到任何路由器页面 一次。第二次单击链接时出现以下错误:Error: Uncaught (in promise): SyntaxError: The string did not match the expected pattern
路由器插座中未加载任何内容。您也可以直接加载任何网址,一切正常。问题总是在单击路由器链接之后。无论您关注哪个 url 或遵循什么顺序,路由器链接在崩溃之前只能工作一次。
这是路由模块。我很确定它不会提供任何线索,但哦,好吧......
import { AuthGuard } from './auth.guard';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{
path: '',
loadChildren: './home/home.module#HomeModule'
},
{
path: 'registro',
loadChildren: './register/register.module#RegisterModule'
},
{
path: 'usuarios',
loadChildren: './user-list/user-list.module#UserListModule',
canActivate: [AuthGuard]
},
{
path: 'usuario',
loadChildren: './user/user.module#UserModule',
canActivate: [AuthGuard]
},
{
path: 'mi-perfil',
loadChildren: './user-edit/user-edit.module#UserEditModule',
canActivate: [AuthGuard]
},
{
path: 'actividad',
loadChildren: './new-edit-event/new-edit-event.module#NewEditEventModule',
canActivate: [AuthGuard]
},
{
path: 'actividades',
loadChildren: './event-list/event-list.module#EventListModule',
canActivate: [AuthGuard]
},
{
path: 'actividad',
loadChildren: './event/event.module#EventModule',
canActivate: [AuthGuard]
},
{
path: 'mensajes',
loadChildren: './chat/chat.module#ChatModule',
canActivate: [AuthGuard]
},
{
path: 'articulos',
loadChildren: './article-list/article-list.module#ArticleListModule',
canActivate: [AuthGuard]
},
{
path: 'articulo',
loadChildren: './article/article.module#ArticleModule',
canActivate: [AuthGuard]
},
{
path: 'legal',
loadChildren: './legal/legal.module#LegalModule',
canActivate: [AuthGuard]
},
{
path: 'admin',
loadChildren: './admin/admin.module#AdminModule',
canActivate: [AuthGuard]
},
{
path: '**',
redirectTo: ''
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, {scrollPositionRestoration: 'enabled'})],
exports: [RouterModule]
})
export class AppRoutingModule { }