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

Templating: server rendering confused by ws-var="Hole" that is also bound as a ${Hole} #200

Closed
Tarmil opened this Issue Oct 25, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@Tarmil
Member

Tarmil commented Oct 25, 2018

Given the following template:

<input ws-var="Name" />  
<div>Hi, ${Name}!</div>
<button ws-onclick="Click">Ok</button>

and the following server-side code:

MyTemplate()
    .Click(fun t -> JS.Alert("Hi" + t.Vars.Name.Value))
    .Doc()
|> Content.Page

there is a runtime error during the rendering of the template:

System.Exception: Invalid hole, expected text: Name
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1645.Invoke(String message)
   at WebSharper.UI.Templating.Runtime.Server.f@1(Boolean keepUnfilled, Boolean plain, RenderContext ctx, HtmlTextWriter w, StringPart _arg5)
[snip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment