Ember 这在组件的组件中未定义

Ember this is undefined in component's component

我正在使用 Ember 2.18。

我有一个名为 map 的组件,在这个组件中我使用了插件 ember-cli-g-maps。对于这个组件,我传递了一个圆形数组。

这是模板:

        {{g-maps
        name='geo-push-map'
        lat=location.lat
        lng=location.lon
        zoom=mapConfig.zoom
        mapType=mapConfig.mapTypeId
        disableDefaultUI=mapConfig.disableDefaultUI
        showZoomControl=mapConfig.zoomControl
        showScaleControl=mapConfig.scaleControl
        circles=circles
        }}

这就是我的圈子数组的样子:

circles: A([
  {
    id: 'my-circle',
    lat: 45,
    lng: 15,
    radius: 2000,
    click(event, circle) {},
    rightclick(event, circle) {},
    dblclick(event, circle) {},
    mouseover(event, circle) {},
    mouseout(event, circle) {},
    mouseup(event, circle) {},
    mousedown(event, circle) {},
    mousemove(event, circle) {},
    drag(e, circle) {},
    dragstart(e, circle) {},
    dragend(e, circle) {},
    radius_changed(circle) {},
    center_changed(circle) {},
    clickable: true,
    draggable: true,
    editable: true,
    fillColor: '#009dd4',
    fillOpacity: 0.3,
    strokeColor: '#005d7d',
    strokeOpacity: 0.3,
    strokePosition: google.maps.StrokePosition.CENTER,
    strokeWeight: 3,
    visible: true,
    zIndex: 999,
  },
]),

我现在希望能够在触发圆圈事件时改变我的地图组件内的 属性。 我这样试过:

...
radius_changed(circle) {
 set(this, 'myRadius', circle.radius);
},
...

但问题是,它告诉我 this 未定义。我怀疑是因为它不存在于圈子的范围内。有不同的方法吗?当然,我阅读了插件的文档以及问题,但找不到解决方法。

我通过使用支持将动作传递给圆圈事件的不同插件解决了这个问题,ember-google-maps