javascript - Generating form inputs in AngularJS with non-uniform structure -
i'm trying generate form each entry rule either enabled or disabled.
i want like:
[x] color blue [x] size @ least [ 50 ] [x] speed @ least [ 20 ] [ 7 ] [ minutes ] [ submit ] where [x] denotes checkbox [ number ] spinbox/edit , [ text ] listbox.
i want generate ruleset template. main question how non-uniform template expansion better done in angularjs? suitable @ kind of tasks?
the source model looks (coffeescript syntax brevity):
color_blue: template: "color {{color}}" params: color: type: "list" values: ["red", "blue" ] default: 1 size_at_least: template: "size @ least {{size}}" params: size: type: "number" min: 30 max: 60 default: 50 speed_at_least: template: "speed @ least {{speed}} {{time}} {{time_units}}" params: speed: type: "number" min: 0 max: 60 default: 0 time: type: "int" min: 0 max: 20 default: 7 unit: type: "list" values: ["seconds", "minutes", "hours" ] default: 1 i can use jquery , generate these rules i'm learning angularjs , prefer learn practical task.
Comments
Post a Comment