Last active
September 28, 2021 22:29
-
-
Save Swimburger/c808f10bcb2c022c624aca233beecca1 to your computer and use it in GitHub Desktop.
Load Blazor Component from JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<title>RenderBlazorFromJs</title> | |
<meta name="description" content="test" /> | |
<base href="/" /> | |
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" /> | |
<link href="css/app.css" rel="stylesheet" /> | |
<link href="RenderBlazorFromJs.styles.css" rel="stylesheet" /> | |
</head> | |
<body> | |
<div id="app">Loading...</div> | |
<div id="blazor-error-ui"> | |
An unhandled error has occurred. | |
<a href="" class="reload">Reload</a> | |
<a class="dismiss">🗙</a> | |
</div> | |
<script src="_framework/blazor.webassembly.js" autostart="false"></script> | |
<script> | |
Blazor | |
.start() | |
.then(() => { | |
const containerElement = document.querySelector('#app') | |
return Blazor.rootComponents.add(containerElement, 'app', {}); | |
}) | |
.catch((error) => console.error(error)); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment