Acredito ter feito todos os passos corretamente, porém ao acessar localhost:4200/user/flavio ou localhost:4200/p/add, fica somente em branco:
app.routing.module.ts:
import { NgModule } from '@angular/core';
import {Routes, RouterModule, Router} from '@angular/router';
import { PhotosListComponent } from './photos/photos-list/photos-list.component';
import { PhotoFormComponent } from './photos/photo-form/photo-form.component';
const routes: Routes = [
{ path: 'user/flavio', component:PhotosListComponent},
{ path: 'p/add', component:PhotoFormComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports:[ RouterModule ]
})
export class AppRoutingModule { }
app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { PhotosModule } from './photos/photos.module';
import { AppRoutingModule } from './app-routing.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
PhotosModule,
AppRoutingModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.html:
<router-outlet></router-outlet>