Skip to content

Commit

Permalink
Inital Release Version
Browse files Browse the repository at this point in the history
Version 0.0.0
- Completed demo
- Fixed bugs highlighted by the demo
- Added disclaimer about the ugliness of the demo
- Added info on where to find the project in the README.md

Signed-off-by: Daniel Hunsaker <[email protected]>
  • Loading branch information
danhunsaker committed Oct 12, 2013
1 parent 1ee6fce commit 6acd327
Show file tree
Hide file tree
Showing 5 changed files with 336 additions and 50 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Build Forms in AngularJS From Nothing But JSON

Installation
------------
Copy `dynamic-forms.js` into your project wherever your other assets reside.
1. Clone the project from either [GitHub][] or [BitBucket][] - whichever you prefer.
2. Copy `dynamic-forms.js` into your project wherever your other assets reside.

Use
---
Expand Down Expand Up @@ -51,8 +52,8 @@ As with any other [AngularJS][] module:

And that's about it!

Full Specification
------------------
The TL;DR Version
-----------------
### The Directive ###
You invoke the `dynamic-form` directive using an element (`<dynamic-form></dynamic-form>`) - other
options (such as class, attribute, and comment) are unsupported (for now). The directive requires
Expand Down Expand Up @@ -165,6 +166,8 @@ what][formsupport])
* The key of each child object specifies the key to associate with the checkbox it describes
* `class`: applies a specific [`ng-class`][] to the current checkbox, independently of the
rest
* `label`: operates identically to the standard `label` option, but applies to a specific
checkbox in the list
* See the [checkbox](#checkbox) type for other fields supported here
* __Other Notes:__
* This is a convenience type, used to tie a group of [checkbox](#checkbox) controls together
Expand Down Expand Up @@ -425,6 +428,14 @@ Acknowledgements
* [K. Scott Allen][] for the [file input directive][filedirective] and the [FileReader
service][fileservice] adapted for use here.

Issues And Assistance
---------------------
If you notice a problem, let me know about it on [GitHub][issues-github] or
[Bitbucket][issues-bitbucket]!

Any and all help is welcome; just fork the project on either [GitHub][] or [BitBucket][] (whichever
you prefer), and submit a pull request with your contribution(s)!

[colorsupport]: http://caniuse.com/input-color
[datesupport]: http://caniuse.com/input-datetime
[filedirective]: http://odetocode.com/blogs/scott/archive/2013/07/05/a-file-input-directive-for-angularjs.aspx
Expand All @@ -434,6 +445,8 @@ Acknowledgements
[pholdsupport]: http://caniuse.com/input-placeholder
[rangesupport]: http://caniuse.com/input-range

[GitHub]: https://github.com/danhunsaker/angular-dynamic-forms
[BitBucket]: https://bitbucket.org/danhunsaker/angular-dynamic-forms
[issues-github]: https://github.com/danhunsaker/angular-dynamic-forms/issues
[issues-bitbucket]: https://bitbucket.org/danhunsaker/angular-dynamic-forms/issues

Expand Down
72 changes: 66 additions & 6 deletions demo/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ angular.module('app', ['dynform'])
"textarea": {
"type": "textarea",
"label": "textarea",
"placeholder": "textarea"
"placeholder": "textarea",
"splitBy": "\n",
"val": ["This array should be","separated by new lines"]
},
"time": {
"type": "time",
Expand Down Expand Up @@ -94,27 +96,85 @@ angular.module('app', ['dynform'])
},
"select": {
"type": "select",
"label": "select"
"label": "select",
"empty": "nothing selected",
"options": {
"first": {
"label": "first option"
},
"second": {
"label": "second option",
"group": "first group"
},
"third": {
"label": "third option",
"group": "second group"
},
"fourth": {
"label": "fourth option",
"group": "first group"
},
"fifth": {
"label": "fifth option"
},
"sixth": {
"label": "sixth option",
"group": "second group"
},
"seventh": {
"label": "seventh option"
},
"eighth": {
"label": "eighth option",
"group": "first group"
},
"ninth": {
"label": "ninth option",
"group": "second group"
},
"tenth": {
"label": "tenth option"
}
}
},
"checklist": {
"type": "checklist",
"label": "checklist"
"label": "checklist",
"options": {
"first": {
"label": "first option"
},
"second": {
"label": "second option",
"isOn": "on",
"isOff": "off"
}
}
},
"radio": {
"type": "radio",
"label": "radio"
"label": "radio",
"values": {
"first": "first option",
"second": "second option",
"third": "third option",
"fourth": "fourth option",
"fifth": "fifth option"
}
},
"button": {
"type": "button",
"label": "button"
},
"hidden": {
"type": "hidden",
"label": "hidden"
"label": "hidden",
"val": "hidden"
},
"image": {
"type": "image",
"label": "image"
"label": "image",
"source": "http://angularjs.org/img/AngularJS-large.png"
},
"legend": {
"type": "legend",
Expand Down
171 changes: 161 additions & 10 deletions demo/form-template.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,193 @@
{
"bogus": {
"type": "bogus",
"label": "bogus"
},
"button": {
"type": "button",
"label": "button"
},
"checkbox": {
"type": "checkbox",
"label": "checkbox"
},
"checklist": {
"type": "checklist",
"label": "checklist",
"options": {
"first": {
"label": "first option"
},
"second": {
"label": "second option",
"isOn": "on",
"isOff": "off"
}
}
},
"color": {
"type": "color",
"label": "color"
},
"date": {
"type": "date",
"label": "date"
"label": "date",
"placeholder": "date"
},
"datetime": {
"type": "datetime",
"label": "datetime"
"label": "datetime",
"placeholder": "datetime"
},
"datetime-local": {
"type": "datetime-local",
"label": "datetime-local"
"label": "datetime-local",
"placeholder": "datetime-local"
},
"email": {
"type": "email",
"label": "email"
"label": "email",
"placeholder": "email"
},
"file": {
"type": "file",
"label": "file",
"multiple": true
},
"hidden": {
"type": "hidden",
"label": "hidden",
"val": "hidden"
},
"image": {
"type": "image",
"label": "image",
"source": "http://angularjs.org/img/AngularJS-large.png"
},
"legend": {
"type": "legend",
"label": "legend"
},
"month": {
"type": "month",
"label": "month",
"placeholder": "month"
},
"number": {
"type": "number",
"label": "number"
"label": "number",
"placeholder": "number"
},
"password": {
"type": "password",
"label": "password"
"label": "password",
"placeholder": "password"
},
"radio": {
"type": "radio",
"label": "radio",
"values": {
"first": "first option",
"second": "second option",
"third": "third option",
"fourth": "fourth option",
"fifth": "fifth option"
}
},
"range": {
"type": "range",
"label": "range",
"model": "number",
"val": 42,
"minValue": -42,
"maxValue": 84
},
"reset": {
"type": "reset",
"label": "reset"
},
"search": {
"type": "search",
"label": "search",
"placeholder": "search"
},
"select": {
"type": "select",
"label": "select",
"empty": "nothing selected",
"options": {
"first": {
"label": "first option"
},
"second": {
"label": "second option",
"group": "first group"
},
"third": {
"label": "third option",
"group": "second group"
},
"fourth": {
"label": "fourth option",
"group": "first group"
},
"fifth": {
"label": "fifth option"
},
"sixth": {
"label": "sixth option",
"group": "second group"
},
"seventh": {
"label": "seventh option"
},
"eighth": {
"label": "eighth option",
"group": "first group"
},
"ninth": {
"label": "ninth option",
"group": "second group"
},
"tenth": {
"label": "tenth option"
}
}
},
"submit": {
"type": "submit",
"label": "submit"
},
"tel": {
"type": "tel",
"label": "tel",
"placeholder": "tel"
},
"text": {
"type": "text",
"label": "text"
"label": "text",
"placeholder": "text"
},
"textarea": {
"type": "textarea",
"label": "textarea"
"label": "textarea",
"placeholder": "textarea",
"splitBy": "\n",
"val": ["This array should be","separated by new lines"]
},
"time": {
"type": "time",
"label": "time"
"label": "time",
"placeholder": "time"
},
"url": {
"type": "url",
"label": "url"
"label": "url",
"placeholder": "url"
},
"week": {
"type": "week",
"label": "week",
"placeholder": "week"
}
}
Loading

0 comments on commit 6acd327

Please sign in to comment.