Event data

I am using Ionic 2 to create an app. I have an event:

import {Events} from 'ionic-angular';

publish

let data = {
  topic: 'foo'
};
this.events.publish('messages:notify', data);

subscribe

  this.events.subscribe('messages:notify', (data) => {
    alert(data.topic);
  });

I expect it to alert 'foo', but it alerts'undefined'.

Any help will be appreciated.

Thanks

The data is passed as an array, so the following works:

  this.events.subscribe('messages:notify', (data) => {
    alert(data[0].topic);
  });