0

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: enter image description here Filestructure:
enter image description here

1 Answer 1

1

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/**"} }
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.