Ionic 2 rc4 Events updated?

Hi, i didn’t see anything about events api in changelogs but in rc3 i got my data like that:

this.events.subscribe("mystring", data => {
    let data = data[0]:
});

And now in rc4 my data aren’t wrapped anymore in an array so i just do :

this.events.subscribe("mystring", data => {
});

So, anything about that in changelogs?
If you get soem errors after update to RC4, check your events subscriptions.

4 Likes

I had to do the same. :weary:

Same - I had to also remove handling as arrays in RC4 - however it only recently went TO that approach, so perhaps it was never meant to be like that.

The same, I’ve spent 1 hour to debug issue, until found that they did this change. That’s terrible, they did not announce it.

1 Like

You can find the related Issue here: https://github.com/driftyco/ionic/pull/8968. I’m sure this will be documented as breaking change in the near future.

1 Like

Same for me, and I thought this was some sort of bug I have “introduced”… didn’t realize it could be related to the rc4 upgrade :unamused:

woe! what is the fix? my app is broken.

oh… i see. nvm.

this.events.subscribe('home-is-loading', (param: any) => {
      this.isLoading = param[0].isLoading;
    });

above should be changed to

this.events.subscribe('home-is-loading', (param: any) => {
      this.isLoading = param.isLoading;
    });
1 Like

Yep, I think it makes more sense this way. Unfortunately it just wasn’t documented so it’s causing some upgrade confusion…