I need to call the class method through console which intern accesses the class variable and then it reflects on the HTML. I Referred Call a service function from browser console in angular 6 but I was unable to access this keyword.
export class AppComponent {
    title = 'calender-app';
    timeslot: any =  [];
    constructor(){
      window['plotEvent'] = this.plotEvent;
    }
  
    plotEvent(events: Calender[]): void{
    // not able to access this.timeslot when I call it from browser's console.
    this.timeslot.push(...events); // getting error as can't read property timeslot of undefined.
    }