Skip to content Skip to sidebar Skip to footer

Nativescript Webview Not Loading Html File

Trying to load a local HTML file into webview in my native-script (typescript) application. It's not loading but shows an error. The

Solution 1:

You have to pass the absolute URL or you can try the following.

import * as fs from "tns-core-modules/file-system";
public webViewSRC: string = encodeURI(`${fs.knownFolders.currentApp().path}/assets/content.html`);

and in your html

<WebView [src]="webViewSRC"></WebView>

Post a Comment for "Nativescript Webview Not Loading Html File"