import { Injectable } from '@angular/core';
import {NavigationExtras, Router} from "@angular/router";

@Injectable({
  providedIn: 'root'
})
export class NavigationService {

  constructor(private  navigation: Router) { }

  public navigate(commands: any[], extras?: NavigationExtras){
    this.navigation.navigate( commands,extras );
  }

  public navigateToEventDetails(idEvent: number){
    this.navigate(['/event-details/'+idEvent ])
  }

  public navigateToHome(idTrainer: number = -1,idEventType : number = -1){
    this.navigate(['/home',{idTrainer: idTrainer, idEventType: idEventType} ]);
  }

  public navigateToLogin(){
    this.navigate(['/login' ])
  }


  public navigateRegistration(idRegistration){
    this.navigate(['/registration/'+idRegistration ])
  }

  public navigateRegistrations(){
    this.navigate(['/registrations' ]);
  }


}
