I\'m trying to insert a web-view on my page and listen the \'loadFinishedEvent\'... But for do this, i need to find the webview in my component
Good link for documentation for using WebView Nativescript/Android
html:
backend code:
import {Component, OnInit} from "@angular/core";
import {WebView, LoadEventData} from "ui/web-view";
@Component({
selector: 'basic-web-view-component',
templateUrl: //see html above
})
export class BasicWebViewComponent implements OnInit {
public url="https://www.google.com";
@ViewChild("webview") webview: WebView;
ngOnInit() {
this.webview.on(WebView.loadFinishedEvent, function (args: LoadEventData) {
console.log("loadFinishedEvent called");
});
}
}
Note: that it seems that WebView needs to sized with width/height attributes are in a GridView, see the docs reference above. It won't dynamically grow based on content.