Ionic 2 rc4 Events updated?


#1

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.


#2

I had to do the same. :weary:


#3

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.


#4

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.


#5

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.


#6

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:


#7

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


#8

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;
    });

#9

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