Reputation: 409
If I want to display a local html file in a Webview, how can I do it?
Tried Solutions:
this.htmlPath = encodeURI(`${fs.knownFolders.currentApp().path}/monitordaten/webview/assets/graph.html`);
<Webview #myWebView [src]="htmlPath" ></Webview>
new CopyWebpackPlugin([
{ from: { glob: "monitrodaten/webview/assets/**"} }, <= Added this row
{ from: { glob: "fonts/**" } },
{ from: { glob: "**/*.jpg" } },
...
both solutions lead to the following error:
Filestructure:
Upvotes: 0
Views: 256
Reputation: 1127
Your path lacks of "app"
this.htmlPath = encodeURI(`${fs.knownFolders.currentApp().path}/app/monitordaten/webview/assets/graph.html`);
or
this.htmlPath = encodeURI(`~/app/monitordaten/webview/assets/graph.html`);
webpack config
{ from: { glob: "app/monitrodaten/webview/assets/**"} }
Upvotes: 1