Skip to content

Commit

Permalink
fix(network): fix onchange method
Browse files Browse the repository at this point in the history
fixes #1173
  • Loading branch information
ihadeed committed Mar 28, 2017
1 parent 19bc841 commit 006f7dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/@ionic-native/plugins/network/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core';
import {Cordova, CordovaProperty, Plugin, CordovaFunctionOverride} from '@ionic-native/core';
import { Cordova, CordovaProperty, Plugin, CordovaCheck } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/observable/merge';


declare var navigator: any;
Expand Down Expand Up @@ -75,8 +76,10 @@ export class Network {
* Returns an observable to watch connection changes
* @return {Observable<any>}
*/
@CordovaFunctionOverride()
onchange(): Observable<any> { return; }
@CordovaCheck()
onchange(): Observable<any> {
return Observable.merge(this.onConnect(), this.onDisconnect());
}

/**
* Get notified when the device goes offline
Expand Down

0 comments on commit 006f7dc

Please sign in to comment.