@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<Alert @ref="alert" />
<button @onclick="(() => alert.Show())">Show using ref</button>
@code {
Alert alert;
}
namespace BlazorFiddleProject
{
using Microsoft.AspNetCore.Components.Builder;
using Microsoft.Extensions.DependencyInjection;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}
public void Configure(IComponentsApplicationBuilder app)
{
app.AddComponent<App>("app");
}
}
}