How to get local ip in Ionic 2?
I have a problem with ionic 2 and network cordova plugin, I am already installing the plugin and in home.ts I declare a variable with the same name, type any, to get the ip address, I see the tutorial of this plugin on github, but in my the application is not working, can you help me?
home.ts:
declare var networkinterface:any;
@Component({
selector: 'page-home',
templateUrl: 'home.html',
providers: [NodeProvider]
})
export class HomePage {
public ip = "";
constructor(public navCtrl: NavController, public loadCtrl: LoadingController, public nodeProvider: NodeProvider, public alertCtrl: AlertController) {
}
ionViewDidLoad(){
networkinterface.getIPAddress(function (ip) {
console.log((ip));
});
}
And the ionic errors are throwing me:
+3
source to share
No one has answered this question yet
Check out similar questions: