import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { DashboardComponent } from './dashboard/dashboard.component'; import { AlbumComponent } from './album/album.component'; import { ArtistComponent } from './artist/artist.component'; import { GenreComponent } from './genre/genre.component'; import { TopPlayedComponent } from './top-played/top-played.component'; import { AlbumsComponent } from './albums/albums.component'; const routes: Routes = [ { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, { path: 'dashboard', component: DashboardComponent }, { path: 'album/:name', component: AlbumComponent }, { path: 'album', component: AlbumsComponent }, { path: 'artist/:name', component: ArtistComponent }, { path: 'genre/:name', component: GenreComponent }, { path: 'top-played', component: TopPlayedComponent } ]; @NgModule({ imports: [ RouterModule.forRoot(routes) ], exports: [ RouterModule ] }) export class AppRoutingModule {}