import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { EntityCardComponent, EntityListComponent, EntityNewComponent } from "./entities.component";


const routes: Routes = [
  {
    path: '',
    data: {
      title: 'Entities',
    },
    children: [
        { path: '', redirectTo: 'list', pathMatch: 'full' },
      {
        path: 'list',
        component: EntityListComponent,
        data: {
          title: 'List',
        },
      },
      {
        path: 'new',
        component: EntityNewComponent,
        data: {
          title: 'New',
        },
      },
      {
        path: ':id',
        component: EntityCardComponent,
        data: {
          title: 'Card',
        },
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class EntitiesRoutingModule {}
