BTW, the current UI.Next templating is documented here, and you can find plenty of examples on Try WebSharper, including an enhanced version of the TODO example.

By on 8/31/2017 5:54 PM ()

Sadly UI.Next.Templating is not documented at all yet as it's still experimental and subject to change so, for now, if you would like to use it you have to figure out what means what from the sample (honestly, without docs, I have to do that time and time again when using the templating).

Now regarding your questions: ${Foo} will always be a View by default because $ inserts a value as text, so it cannot be changed from the view, only from the model. Here, for ${NewTaskName}, we have this line too:

1
<label>New task: <input data-var="NewTaskName" placeholder="Add task here" /></label>

Which means we bind NewTaskName to an input tag which requires it to be a Var (since it can be changed from the view as well). Now the type provider can figure out that those two are bindings for the same variable thus it has to be a Var and not a View (and it's trivial to get a View from a Var).

By on 7/29/2015 12:51 AM ()

Ah, I see! The last paragraph of your answer explains everything to me. Thanks Istvan!

By on 7/29/2015 4:33 PM ()

This said, with the upcoming 3.4, we are introducing $!{...} to refer to views, and ${...} will remain to refer to string placeholders. This was necessary to enhance the UI.Next templating engine to serve sitelets (that have static, non-reactive placeholders) as well - in essence, now usable for both client and server scenarios.

(The commit to establish this is here.)

By on 7/29/2015 3:56 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper