In NativeScript how do I show a local HTML file if the WebView is offline.
In this example I try to load a string instead of a file. But I can't get this to work ether.
let errorHtml = `
<html>
<style>
body {
background-color: red;
color: #fff;
}
</style>
<body>
<h1>Error</h1>
</body>
</html>
`;
webView.on(webViewModule.WebView.loadFinishedEvent, (args) => {
if (!args.error) {
loadLanguagesInWebView();
listenLangWebViewEvents();
} else {
webView.src = errorHtml;
}
});
webView.src = "www.google.com";