Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

'router-outlet' is not a known element

Pessoal em home component html não está aparecendo as rotas filhas no lado direito da tela, somente a imagem a esquerda. Está aparecendo esse erro no console:

Error: src/app/home/home.component.html:8:11 - error NG8001: 'router-outlet' is not a known element:
    1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
    2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

    8           <router-outlet></router-outlet>

Segue app routing module:

import { HomeComponent } from './home/home.component';
import { PhotoFormComponent } from './photos/photo-form/photo-form.component';
import { PhotosListComponent } from './photos/photos-list/photos-list.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { NotFoundComponent } from './errors/not-found/not-found.component';
import { Resolver } from './photos/photos-list/photos-list.resolver';
import { SignInComponent } from './home/signin/signin.component';
import { AuthGuard } from './core/auth/auth.guard';
import { SignUpComponent } from './home/signup/signup.component';

const routes: Routes = [
  {
    path: '',
    component: HomeComponent,
    canActivate: [AuthGuard],
    children: [
      {
        path: '',
        component: SignInComponent,
      },
      {
        path: 'signup',
        component: SignUpComponent,
      },
    ],
  },
  {
    path: 'users/:userName',
    component: PhotosListComponent,
    resolve: { photos: Resolver },
  },
  { path: 'p/add', component: PhotoFormComponent },
  { path: '**', component: NotFoundComponent },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
})
export class AppRoutingModule {}
1 resposta
solução!

Encontrei o erro... Não tinha colocado HomeComponent em declarations no HomeModule e então o HomeComponent não tinha acesso as diretas de Router do RouterModule.

import { HomeComponent } from './home.component';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { VMessageModule } from '../shared/component/vmessage/vmessage.module';
import { SignInComponent } from './signin/signin.component';
import { SignUpComponent } from './signup/signup.component';

@NgModule({

  declarations: [ SignInComponent, SignUpComponent, HomeComponent ],
  imports: [ CommonModule, FormsModule, ReactiveFormsModule, VMessageModule,RouterModule ]
})

export class HomeModule{}