search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to routing on onEventClicked: function (args) { } ANGULAR

Asked by Kar
6 years ago.

I want go to page using event clicked function, but innested function not working

Answer posted by Dan Letecky [DayPilot]
6 years ago.

Try using the TypeScript syntax:

constructor(private router: Router) { }
config: any = {
  onEventClicked: args => {
    this.router.navigate(.....);
  }
}

When using the JavaScript syntax "this" points to DayPilot.Scheduler instance instead of your component:

config: any = {
  onEventClicked: function(args) {
    // this === DayPilot.Scheduler instance
  }
}
Comment posted by Kar
6 years ago.

Thanks a lot

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.