Ejemplo n.º 1
0
        public static void DefineNiceController()
        {
            AngularJSDemo.hwbApp.Controller<ControllerDataObjectStructure>
                ("hwcSctl", CtlFunction);

            var ctlDiv = new DivElement();
            ctlDiv.SetNGController("hwcSctl");
            Document.Body.AppendChild(ctlDiv);

            var fltFld = new InputElement();
            fltFld.SetNGModel("hwcFlt");
            ctlDiv.AppendChild(fltFld);

            var ordFld = new SelectElement();
            ordFld.SetNGModel("hwcOrderBy");
            ordFld.Add(new OptionElement() {
                Value = "Checkpoint",
                InnerHTML = "Alphabetically"
            });
            ordFld.Add(new OptionElement() {
                Value = "id",
                InnerHTML = "Series ID"
            });
            ctlDiv.AppendChild(ordFld);

            var rptSpan = new SpanElement();
            rptSpan.SetNGRepeat("checkpoint", "checkpoints", fltFld.GetNGModel(),
                ordFld.GetNGModel());
            rptSpan.InnerHTML = "{{checkpoint.callsign}}[{{checkpoint.id}}] ";
            ctlDiv.AppendChild(rptSpan);
        }
Ejemplo n.º 2
0
        public static Element GetOrderBySelector(string ngModelName)
        {
            var itemsOrderSelector = new SelectElement();
            itemsOrderSelector.SetNGModel(ngModelName);

            itemsOrderSelector.Add(new OptionElement() {
                Value = "",
                InnerHTML = "No special order"
            });

            itemsOrderSelector.Add(new OptionElement() {
                Value = "name",
                InnerHTML = "CallSign"
            });

            itemsOrderSelector.Add(new OptionElement() {
                Value = "id",
                InnerHTML = "Internal"
            });

            return itemsOrderSelector;
        }