Ionic2 project. I used InAppBrowser in typescript and webview is based on tomcat server. I want to call typescript funtion from external javascript function. How can i call that function? Below my code.
import { Component, ViewChild, ElementRef } from '@angular/core';
import { NavController, Content } from 'ionic-angular';
import { InAppBrowser } from '@ionic-native/in-app-browser';
import * as $ from 'jquery';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild(Content) content: Content;
constructor(public navCtrl: NavController, private iab: InAppBrowser,
private elementRef : ElementRef) {
var ref = window.open(url, '_self', 'location=yes');
}
}
function getGPS(e):string { //the function returns a string
return "client getGPS func" ;
}
I just want to call getGPS function in javascript function. This is my javascript code.
umn2={
getGPS: function(){
document.getElementById("resultArea").value = //that is client part
}
};
Please tell me the solutions. Thank you.