Web-Development-with-Blazor.../Chapter15/CustomElements/BlazorCustomElements/Program.cs

12 lines
418 B
C#
Raw Normal View History

2023-02-17 15:28:17 +01:00
using BlazorCustomElements;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.RegisterCustomElement<Counter>("my-blazor-counter");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();