Ionic2 event subscription with [hidden] in view

Hi all,
i am facing a problem when trying to change a variable in an event listener:

pagename.ts
// subscribe to the event events.subscribe('connection:online', () => { this.connection = true; });

pagename.html
<div [hidden]="connection"> <h1 text-center>No connection</h1> </div>

When i am on the page and the event gets fired (in my case activating internet on my device), the view does not update and hide the [hidden] section).
any idea?

thanks, martin

Looks like you’re using a cordova plugin directly to detect online/offline changes, which means Angular won’t be notified when your listener is called, and change detection won’t run.

I recommend using Network from Ionic Native to avoid this issue: http://ionicframework.com/docs/v2/native/network/