Skip to content

@ionic-native/network plugin not working #1429

@aneeskodappana

Description

@aneeskodappana
Module '"C:/Users/anees/network/node_modules/@ionic-native/core/index"' has no exported member 'IonicNativePlugin'.

capture

// home.ts
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Network } from '@ionic-native/network';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController, private network: Network) {
  	// watch network for a disconnect
		let disconnectSubscription = this.network.onDisconnect().subscribe(() => {
		  console.log('network was disconnected :-(');
		});
  }

}


also add to the providers array in app.module.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions