Setup for WebAssembly
ryanbuening opened this issue · comments
Describe the bug
I tried following the documentation for setup with Blazor using WebAssembly but I'm unable to successfully get it working.
To Reproduce
Steps to reproduce the behavior: (tried to follow readme documentation)
- Install CurrieTechnologies.Razor.SweetAlert2 version 3.0.0
- Add
builder.Services.AddSweetAlert2();
toMain()
inProgram.cs
- Add
<script src="_content/CurrieTechnologies.Razor.SweetAlert2/sweetAlert2.min.js"></script>
toindex.html
- Add
@using CurrieTechnologies.Razor.SweetAlert2
to _Imports.razor - Add
@inject SweetAlertService Swal;
toFooPage.razor
- Add
<button class="btn btn-primary" @onclick="(async () => await Swal.FireAsync("Any fool can use a computer"))">Try me!</button>
toFooPage.razor
Expected behavior
FooPage.razor compiles and runs
Actual behavior
FooPage.razor reports error: CS1026 ) expected
Additional context
Running Visual Studio 2019 16.8.0 Preview 3.1 with net5.0 (rc1)
You are missing @ before (
<button class="btn btn-primary" @onclick="@(async () => await Swal.FireAsync("Any fool can use a computer"))">Try me!</button>