如何在表单中添加选择字段?

时间:2014-08-14 15:09:35

标签: javascript jquery angularjs angularjs-directive

您能否告诉我如何在角度js中添加选择字段。我正在使用此字段。 https://github.com/danhunsaker/angular-dynamic-forms 我可以添加文本字段,但没有文档如何添加选择字段

http://plnkr.co/edit/zCF4oZ5pNWbARaONSGtY?p=preview

var apep=angular.module('app', ['dynform']);
apep.controller('AppCtrl', ['$scope', function ($scope) {

       $scope.formTemplate = {
        "first": {
            "type": "text",
            "label": "First Name"
        },
        "last": {
            "type": "text",
            "label": "Last Name"
        },
        "submit": {
            "type": "submit"
        }
    };
}])

1 个答案:

答案 0 :(得分:0)

您已完成下拉列表:

"select": {
      "type": "select",
      "label": "Dropdown",
      "options": {
              "1": {
                  "label": "North East"
              },
              "2": {
                  "label": "All"
              },
              "3": {
                  "label": "South Texas"
              },
              "4": {
                  "label": "Permian"
              },
              "5": {
                  "label": "Mid Continent"
              },
              "15": {
                  "label": "West"
              }
          }
    }

此处的Plunker:Dropdown Example