is there a way to provide a global JavaScript function in an Angular App, which can be called by non-Angular JS code?
Background: Our Angular app is running inside a webview of a Qt application. Now we are investigating possibilities to provide an API, so that the Qt application can call functions of the Angular app.
Any front-end javascript code (including Angular) has access to global objects
windowanddocument. You can add any function or property into those 2.I'm not familiar with QT WebView, so I can not help you to understand if you can get access
windowordocumentfrom the QT code. I would rather expect you can.As another solution - https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage. Don't know if QT code can react to those messages.