title: Angular fullcalendar adding an event when clicking on the day
body: <p>Hi hope you will help me on this</p>
  <p>I'm working on Angular 10 and full calendar v5 and I want to know how can I add an event into the day when clicking on it</p>
  <pre><code>export class CalendarComponent implements OnInit{
  
    nomaction;
  
    constructor(public dialog: MatDialog) { }
  
    ngOnInit(): void {
      
    }
  
  
  calendarOptions: CalendarOptions = {
      initialView: 'dayGridMonth',
      weekends: true,
      dateClick: this.handleDateClick.bind(this), // bind is important!
      events: [
        { title: 'event 1', date: '2020-08-20' },
        { title: 'event 2', date: '2020-08-21' }
      ]
    };
  
    handleDateClick(arg) {
    
      const dialogRef = this.dialog.open(AddeventComponent, {
        width: '250px',
        data: {nomaction: this.nomaction}
      });
  
      dialogRef.afterClosed().subscribe(result =&gt; {
        this.nomaction = result.nomaction;
        this.calendarOptions.events = [{ title: this.nomaction, date: arg.dateStr }];//a code for adding an event into the day
        console.log('action',this.nomaction);
      });
  
     
    }
  
    toggleWeekends() {
      this.calendarOptions.weekends = !this.calendarOptions.weekends 
       }
  
   }
  </code></pre>
  <p>this.calendarOptions.events is not an array so I couldn't use push to add the object !</p>
  <p>How can I add it without losing my first data !</p>