Fix: @HostListener does not work in a angular service. [ci skip]

pull/7944/head
Wieland Lindenthal 5 years ago
parent 81a1999ca5
commit b79d8f0136
  1. 13
      frontend/src/app/modules/bcf/services/revit-bridge.service.ts

@ -16,21 +16,20 @@ export class RevitBridgeService {
return this._ready;
}
@HostListener('window:revit.client.loaded')
onRevitClientLoaded() {
console.log('EVENT onRevitClientLoaded');
this.hookUpRevitListener();
}
constructor() {
if (window.bcfierBridge) {
this.hookUpRevitListener();
} else {
window.addEventListener('revit.plugin.ready', () => {
console.log('CAPTURED EVENT "revit.plugin.ready"');
this.hookUpRevitListener();
});
}
}
public sendMessageToRevit(messageType:string, trackingId:string, messagePayload?:any) {
if (!this.ready) {
console.log('The BCFier Revit Bridge is not ready yet.');
console.log('The Revit bridge is not ready yet.');
return;
}

Loading…
Cancel
Save