Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for @bind:get, @bind:set, @bind:after #155

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

ScarletKuro
Copy link
Member

Razor team doesn't provide new nuget assemblies for Razor language: dotnet/razor#9494 (comment)

We are forced to manually extract the libraries and reference them.
These assemblies I took directly from the SDK, so they should be considered "stable".

<h1>Bind Get Set Examples</h1>

<h2>Elements</h2>

<input type="text" @bind:get="text" @bind:set="(value) => { text = value; }" />
<input type="text" @bind:get="text" @bind:set="Set" />
<input type="text" @bind:get="text" @bind:set="SetAsync" />

@text

@code {
    private string text = "test";

    private void Set(string value)
    {
        text = value;
    }

    private Task SetAsync(string value)
    {
        text = value;
        return Task.CompletedTask;
    }
}

This code should now work.

@ScarletKuro ScarletKuro changed the title Add support for @bind:get, @bind:set, @bind:after Add support for @bind:get, @bind:set, @bind:after Oct 31, 2024
@henon henon merged commit 63105a2 into main Oct 31, 2024
2 checks passed
@henon
Copy link
Collaborator

henon commented Oct 31, 2024

Big thanks @ScarletKuro!

@ScarletKuro ScarletKuro deleted the update_razorlang branch October 31, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants