Ejemplo n.º 1
0
        static public IControlBody Main()
        {
            var rvInput   = Var.Create(new JobSearchCriteria());
            var submit    = Submitter.CreateOption(rvInput.View);
            var vReversed =
                submit.View.MapAsync(input =>
            {
                if (input == null)
                {
                    return(Task.FromResult(""));
                }
                return(Task.FromResult("perd"));
            });

            return(Html.div(
                       Html.input(rvInput),
                       Html.button("Send", submit.Trigger),
                       Html.hr(),
                       Html.h4(
                           Html.attr.@class("text-muted"),
                           "The server responded:",
                           Html.div(
                               Html.attr.@class("jumbotron"),
                               Html.h1(vReversed)
                               )
                           )
                       ));
        }