Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/473.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在重建之前,angular找不到模块_Javascript_Angular - Fatal编程技术网

Javascript 在重建之前,angular找不到模块

Javascript 在重建之前,angular找不到模块,javascript,angular,Javascript,Angular,我有一个非常奇怪的问题,在到达我的路线之前,我不得不通过改变文件中的某些内容并重新加载发球来重建我的角度 以下是我的文件夹结构: app-routing.module.ts 登录路由模块 有人能告诉我发生了什么吗?在路由器配置中使用children属性时,必须有嵌套的present。否则,该路由将在控制台中不存在错误,但不会呈现该组件 检查我的闪电战 登录组件有一个路由器出口,用于呈现在children属性中定义的路由。如果您对此进行注释,您将看到路由是有效的,但是注册组件没有呈现。我通常发现,

我有一个非常奇怪的问题,在到达我的路线之前,我不得不通过改变文件中的某些内容并重新加载发球来重建我的角度

以下是我的文件夹结构:

app-routing.module.ts

登录路由模块

有人能告诉我发生了什么吗?

在路由器配置中使用children属性时,必须有嵌套的present。否则,该路由将在控制台中不存在错误,但不会呈现该组件

检查我的闪电战


登录组件有一个路由器出口,用于呈现在children属性中定义的路由。如果您对此进行注释,您将看到路由是有效的,但是注册组件没有呈现。

我通常发现,当我添加新模块时,我需要重新启动开发服务器。我想这里面有一些cache@C_Ogoo您通常如何重新启动它?按Ctrl+C停止开发服务器并再次运行ng serve命令。@C_ogo这就是我所想的:P不起作用:D这已经过了几天,特别是无法到达路线,还是全部都是这样?
    import {NgModule} from '@angular/core';
import {PreloadAllModules, RouterModule, Routes} from '@angular/router';
import {redirectUnauthorizedTo, canActivate} from '@angular/fire/auth-guard';

const redirectUnauthorizedToLanding = redirectUnauthorizedTo(['/login/signin']);

    const routes: Routes = [
        {
            path: '',
            loadChildren: () => import('../login/login.module').then(m => m.LoginModule)
        },
        {
            path: 'dashboard',
            loadChildren: './dashboard/dashboard.module#DashboardPageModule',
            ...canActivate(redirectUnauthorizedToLanding)

        },
        {path: 'statistic', loadChildren: './statistic/statistic.module#StatisticPageModule'}


    ];

    @NgModule({
        imports: [
            RouterModule.forRoot(routes, {preloadingStrategy: PreloadAllModules})
        ],
        exports: [RouterModule]
    })
    export class AppRoutingModule {
    }
    import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AngularFireAuthModule} from "@angular/fire/auth";
import {ReactiveFormsModule} from "@angular/forms";

const routes: Routes = [
    {
        path: 'login',
        pathMatch: 'prefix',
        children: [
            {
                path: 'signin',
                loadChildren: './pages/sign-in/sign-in.module#SignInPageModule'
            },
            {
                path: 'signup',
                loadChildren: './pages/sign-up/sign-up.module#SignUpPageModule'
            },
        ]
    },
];

@NgModule({
    imports: [RouterModule.forChild(routes), AngularFireAuthModule, ReactiveFormsModule],
    exports: [RouterModule]
})
export class LoginRoutingModule {
}