If your web app uses Angular and you want to trigger Birdie from Javascript code, you might encounter an issue when accessing window.birdie object that is not found… 🤔
This is related to the way Angular handles the global window object, but there is a smart solution kindly shared by one of our beloved users:
Let's assume you want to use the window.birdie.widget.open() method as indicated into our Javascript Cheat Sheet, you might need to handle things this way:
declare global {
interface Window {
birdie: any;
}
}
@Component({
...
providers: [{ provide: Window, useValue: window }],
})
open_Birdie_Programmatically() {
this.window.birdie.widget.open()
}
// now call open_Birdie_Programmatically() and it should do the job