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

import { InfoComponent } from './info.component'
import { InfoHomeComponent } from './info-home/info-home.component'
import { InfoResolver } from './info-resolver.service'

const routes: Routes = [
    {
        path: '',
        component: InfoComponent,
        outlet: 'info',
    },
    {
        path: ':type/:id',
        component: InfoComponent,
        outlet: 'info',
        resolve: {
            item: InfoResolver
        }
    }
]

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