I\'d like to be able to pass some data\\propagate events from a plugin on the page to my Angular 4 app.
More specifically, in my case data\\events are generated insi
You can use a events, so you have the JavaScript send an event that you are listening for in your service.
The CustomEvent is a new feature so you might need to polyfill it: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
JavaScript:
var event = new CustomEvent("CallAngularService");
window.dispatchEvent(event);
Angular:
@HostListener("window:CallAngularService")
onCallAngularService() {
// Run your service call here
}