mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-04 21:17:36 +08:00
6db07ad916
* feat: add component modal * fix: adjust namespace and fix TAB keyboard bug * fix: reset package.json to cuueernt head * fix: remove antblazor.sln * refactor: using c# to control the display and hiding of modal
30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using System.Net.Http;
|
|
using System.Text.Encodings.Web;
|
|
using AntDesign;
|
|
using AntDesign.JsInterop;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddAntDesign(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<IconService>();
|
|
services.TryAddScoped<InteropService>();
|
|
services.TryAddScoped<NotificationService>();
|
|
services.TryAddScoped<MessageService>();
|
|
services.TryAddScoped<ModalService>();
|
|
|
|
return services;
|
|
}
|
|
}
|
|
}
|