public void Constructor_ValidatesComponentType_Success() { // Arrange // Act var mapping = new RootComponentMapping(typeof(Router), "test"); // Assert (does not throw) GC.KeepAlive(mapping); }
/// <summary> /// Installs a LoadingBar service to the runtime hosting environment. /// </summary> /// <param name="hostBuilder">The Microsoft.AspNetCore.Blazor.Hosting.WebAssemblyHostBuilder.</param> public static WebAssemblyHostBuilder UseLoadingBar(this WebAssemblyHostBuilder hostBuilder) { if (!Installed) { var mapping = new RootComponentMapping(typeof(ScriptInjectorComponent), "script[src]"); hostBuilder.RootComponents.Insert(0, mapping); } Installed = true; return(hostBuilder); }
public Module() { RootComponentMapping = new RootComponentMapping(typeof(App), "app"); }