Angular project. The component is connected fullCalendar ( https://fullcalendar.io ). The calendar uses jQuery and is connected as shown below. How to specify the transition to another component of angular in the dayClick processing function? I know that you can import the Router and write this.router.navigate(['/path']) , but I don’t know how to correctly pass the Router to the jQuery function
import { Component, OnInit } from '@angular/core'; import * as $ from 'jquery'; import 'fullcalendar'; import {User} from "../user"; import {DataService} from "../data.service"; import {Router} from "@angular/router"; @Component({ selector: 'app-fullcalendar', templateUrl: './fullcalendar.component.html', styleUrls: ['./fullcalendar.component.css'] }) export class FullcalendarComponent implements OnInit { constructor(private dataService: DataService, private router: Router) { } ngOnInit() { $(function() { let containerEl: JQuery = $('#calendar'); containerEl.fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay,listWeek' }, navLinks: true, // can click day/week names to navigate views editable: true, eventLimit: true, // allow "more" link when too many events eventSources: [{ url: 'api/shedules' }], eventClick: function(calEvent, jsEvent, view) { alert('Запись: ' + calEvent.title); }, dayClick: function(calEvent, jsEvent, view) { } }) }); } }