mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
cd73cf1cdd
* feat: add notification * fix: onclick event trigger on onclise on server rendering * fix: notification no longer requires container * fix: convert OnClick and OnClose type to event
27 lines
851 B
C#
27 lines
851 B
C#
using System.Net.Http;
|
|
using System.Text.Encodings.Web;
|
|
using AntBlazor;
|
|
using AntBlazor.JsInterop;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.Logging;
|
|
using Microsoft.JSInterop;
|
|
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddAntBlazor(this IServiceCollection services)
|
|
{
|
|
services.TryAddSingleton<HttpClient>();
|
|
services.TryAddScoped<DomEventService>();
|
|
services.TryAddScoped(sp => new HtmlRenderService(new HtmlRenderer(sp, sp.GetRequiredService<ILoggerFactory>(),
|
|
s => HtmlEncoder.Default.Encode(s)))
|
|
);
|
|
|
|
services.TryAddScoped<AntNotificationService>();
|
|
|
|
return services;
|
|
}
|
|
}
|
|
}
|