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

router-outlet erro

Segui o passo a passo da aula porém está me exibindo o seguinte erro: Unhandled Promise rejection: Template parse errors: '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.schema' of this component to suppress this message. ("[ERROR ->]"): AppComponent@0:0 ; Zone: ; Task: Promise.then ; Value: Error: Template parse errors: '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.schema' of this component to suppress this message. ("[ERROR ->]"): AppComponent@0:0

app.component

import {Component} from '@angular/core';
import { Http } from '@angular/http';

@Component({
    moduleId: module.id,
    selector: 'app',
    templateUrl: './app.component.html'
})
export class AppComponent {

}

app.component.html

<router-outlet></router-outlet>

app.route

import { RouterModule, Routes } from '@angular/router';
import{ CadastroComponent } from './cadastro/cadastro.component' ;
import { ListagemComponent} from './listagem/listagem.component';

const appRoutes: Routes = [
    { path: '', component: ListagemComponent},
    {path: 'cadastro', component: CadastroComponent},
    { path: '**', redirectTo: ''}
];

export const routing = RouterModule.forRoot(appRoutes);
1 resposta
solução!

Descobri! faltou inserir o routing na tag imports do AppModule.

imports: [ BrowserModule, FotoModule, HttpModule, PainelModule, routing ],