I am attempting to invoke an Angular 5 function from my Android WebView.
Within the Android code:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT){
this.mWebView.evaluateJavascript("fooBar();", null);
} else {
this.mWebView.loadUrl("fooBar();");
}
In my Angular component, I have included the fooBar function
Within the Angular Component:
fooBar=function(){
console.log("fooBar");
}
However, the above code is resulting in an
Error Message:
VM772:1 Uncaught ReferenceError: fooBar is not defined at <anonymous>:1:1
Can anyone provide guidance on how to call a TypeScript function from an Android Webview
?