 
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { AvisoResolver } from './pages/aviso/aviso.resolver'; // Importieren Sie den Resolver

const routes: Routes = [
  {
    path: 'home',
    loadChildren: () => import('./pages/home/home.module').then(m => m.HomePageModule)
  },
  {
    path: 'aviso',
    loadChildren: () => import('./pages/aviso/aviso.module').then(m => m.AvisoPageModule),
    resolve: { avisoData: AvisoResolver } // Hinzufügen des Resolvers zur Route
  },
  {
    path: '',
    redirectTo: 'aviso',
    pathMatch: 'full'
  },
  {
    path: '**',
    redirectTo: 'aviso'
  }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule { }
