-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Description
Description
File wwwroot/scripts.js from the example of Blazor component initialization from js looks like this
Copy
window.showQuote = async () => {
let targetElement = document.getElementById('quoteContainer');
await Blazor.rootComponents.add(targetElement, 'quote',
{
text: "Crow: I have my doubts that this movie is actually 'starring' " +
"anybody. More like, 'camera is generally pointed at.'"
});
}
const btn = document.querySelector("showQuoteBtn");
btn.addEventListener("click", showQuote);
This line const btn = document.querySelector("showQuoteBtn"); does not contain identifier that would match later presented html, # is missing. Correct version should look like this const btn = document.querySelector("#showQuoteBtn");
Page URL
Content source URL
Document ID
444b03b4-f910-656a-642c-6c9064d6ce28
Article author
Metadata
Metadata
Assignees
Type
Projects
Status
Done