Property 'connection' does not exist on type 'Navigator' using Ionic2 and Angular2
<p>I want to check my network using Ionic 2 and Angular 2. I receive a strange error that I cannot understand.</p>

<p>My app.ts is:</p>

<pre><code>import {App, Platform} from 'ionic-angular';
import {StatusBar} from 'ionic-native';
import {HomePage} from './pages/home/home';


@App({
  template: '&lt;ion-nav [root]="rootPage"&gt;&lt;/ion-nav&gt;',
  config: {} // http://ionicframework.com/docs/v2/api/config/Config/
})
export class MyApp {
  rootPage: any = HomePage;

  static get parameters() {
    return [[Platform]];
  }


  constructor(platform: any) {
    this.rootPage = HomePage;

    platform.ready().then(() =&gt; {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();
    });
  }

}
</code></pre>

<p>My home.ts:</p>

<pre><code> import {App, Platform} from 'ionic-angular';
    import {StatusBar} from 'ionic-native';
    import {Network, Connection} from 'ionic-native';
    import {Page} from 'ionic-angular';



    @Page({
      templateUrl: 'build/pages/home/home.html',
    })

    export class HomePage {
      rootPage: any = HomePage;

      navigator = navigator;

      constructor(public platform: Platform) {
        this.platform = platform;
      }


      checkNetwork() {

        this.platform.ready().then(() =&gt; {
          // Problem1
          var networkState = navigator.connection.type;

          var states = {};
          states[Connection.UNKNOWN] = 'Unknown connection';
          states[Connection.ETHERNET] = 'Ethernet connection';
          states[Connection.WIFI] = 'WiFi connection';
          states[Connection.CELL_2G] = 'Cell 2G connection';
          states[Connection.CELL_3G] = 'Cell 3G connection';
          states[Connection.CELL_4G] = 'Cell 4G connection';
          states[Connection.CELL] = 'Cell generic connection';
          states[Connection.NONE] = 'No network connection';

          alert('Connection type: ' + states[networkState]);

        });

      }

    }
</code></pre>

<p>My home.html</p>

<pre><code>&lt;ion-navbar *navbar&gt;
    &lt;ion-title&gt;
        Home
    &lt;/ion-title&gt;
&lt;/ion-navbar&gt;

&lt;ion-content class="home"&gt;
    &lt;button (click)="checkNetwork()"&gt;Check Network&lt;/button&gt;
&lt;/ion-content&gt;
</code></pre>

<p>I receive one error and I totally not understand the reason:</p>

<pre><code>1 - Property 'connection' does not exist on type 'Navigator'
</code></pre>

<p><strong>Update:</strong></p>

<p>I went to Ionic 2 site and currently my home.ts file look like this:</p>

<pre><code>import {Platform, Page} from 'ionic-angular';
import {Connection} from 'ionic-native';
import {Network} from 'ionic-native';

@Page({
  templateUrl: 'build/pages/home/home.html',
})

export class HomePage {
  rootPage: any = HomePage;

  constructor(public platform: Platform) {
    this.platform = platform;
  }


  checkConnection() {
    console.log("entrou");

    console.log(Network);

    // watch network for a disconnect
    let disconnectSubscription = Network.onDisconnect().subscribe(() =&gt; {
      console.log('network was disconnected :-( ')
    });

    // stop disconnect watch
    disconnectSubscription.unsubscribe();



    // watch network for a connection
    console.log("watch network");
    console.log("Conexao" + Network.connection);
    let connectSubscription = Network.onConnect().subscribe(() =&gt; {
      console.log('network connected!');
      // We just got a connection but we need to wait briefly
      // before we determine the connection type.  Might need to wait?
      // prior to doing any api requests as well.
      setTimeout(() =&gt; {
        console.log(Network.connection);
        if (Network.connection === Connection.WIFI) {
          console.log('we got a wifi connection, woohoo!');
        }
      }, 3000);
    });

    console.log("Sub" + connectSubscription);
    // stop connect watch
    connectSubscription.unsubscribe();
  }
}
</code></pre>

<p>I get a console message saying:</p>

<p>Native: tried accessing the Network plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator</p>