事件发射器在事件侦听器中不起作用

时间:2021-04-22 13:50:45

标签: angular openlayers-6

我使用 Angular 和 OpenLayers。单击角度按钮时,我调用函数(内部服务)执行以下操作:

this.draw.on('drawend', function(event) {
  this.drawEvent.next([this.feature, this.featureLayer]);
});

drawEvent 应该调用组件,但没有任何反应。 当我在 this.draw.on 之外发出 drawEvent 时它工作正常。

它与 NgZone 有什么关系吗?我是 Angular 的初学者,任何提示都会有所帮助。

0 个答案:

没有答案