I am working on an outlook web add-in (in Angular 5) and I am implementing a pinnable task pane and I've been following this documentation from Microsoft : Implement a pinnable task pane in Outlook.
What I want to do is when the selected mail in Outlook was changed, I need to update the content of my task pane UI.
On My Component.TS I added the following addHandlerSync event listener for change on mail selection:
ngOnInit() {
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, this.selectMailChanged);
}
selectMailChanged(){
this.getPhoneNumbers() //This function gets phone numbers on the email
}
The error of the above code is
this.getPhoneNumbers is not defined
.
I tried enclosing this this.getPhoneNumbers on zone (based on MS Documentation: Trigger the UI update) but it returns zone.run is not defined.
How can I call an angular component method on addHandlerAsync callback?