Após os ajustes de app-routing.module e home.routing.module a página de login não é carregada e acusa o seguinte erro: find module './home/home.module.ts' Error: Cannot find module './home/home.module.ts'
e outro detalhe ao fazer o Build: não gerou o arquivo '0' como mencionado no video:
home.routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
import { AuthGuard } from '../core/auth/auth.guard';
import { SignInComponent } from './signin/signin.component';
import { SignUpComponent } from './signup/signup.component';
const routes: Routes = [
{
path: '',
component: HomeComponent,
canActivate: [AuthGuard],
children: [
{
path: '',
component: SignInComponent,
},
{
path: 'signup',
component: SignUpComponent,
},
]
},
];
@NgModule({
imports: [
RouterModule.forChild(routes) ,
],
exports: [RouterModule]
})
export class HomeRoutingModule { }
app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { NotFoundComponent } from './errors/not-found/not-found.component';
import { PhotoFormComponent } from './photos/photo-form/photo-form.component';
import { PhotoListComponent } from './photos/photo-list/photo-list.component';
import { PhotoListResolver } from './photos/photo-list/photo-list.resolver';
const routes: Routes = [
{
path: '',
pathMatch: 'full',
redirectTo: 'home'
},
{
path: 'home',
loadChildren: './home/home.module.ts#HomeModule',
},
{
path: 'user/:userName',
component: PhotoListComponent,
resolve: {
photos: PhotoListResolver
}
},
{
path: 'p/add',
component: PhotoFormComponent
},
{
path: '**',
component: NotFoundComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: true } ) ],
exports: [RouterModule]
})
export class AppRoutingModule { }
home.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule , FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { VMessageModule } from '../shared/components/vmessage/vmessage.module';
import { SignInComponent } from './signin/signin.component';
import { SignUpComponent } from './signup/signup.component';
import { HomeComponent } from './home.component';
import { HomeRoutingModule } from './home.routing.module';
@NgModule({
declarations: [
SignInComponent,
SignUpComponent,
HomeComponent
],
imports: [ CommonModule,
FormsModule,
ReactiveFormsModule,
VMessageModule,
RouterModule,
HomeRoutingModule
],
exports: [
SignUpComponent
]
})
export class HomeModule { }
Onde eu errei?
As outras páginas eu consigo acessar normalmente!