@@ -16,6 +16,7 @@ Documentation
1616 1 . [ actions] ( #actions )
1717 1 . [ button] ( #button )
1818 1 . [ radios and radiobuttons] ( #radios-and-radiobuttons )
19+ 1 . [ help] ( #help )
19201 . [ Post process function] ( #post-process-function )
2021
2122Form types
@@ -38,6 +39,7 @@ Schema Form currently supports the following form field types out of the box:
3839| button | a button |
3940| radios | radio buttons |
4041| radiobuttons | radio buttons with bootstrap buttons |
42+ | help | insert arbitrary html |
4143
4244More field types can be added, for instance a "datepicker" type can be added by
4345including the [ datepicker addon] ( datepicker.md )
@@ -364,6 +366,42 @@ function FormCtrl($scope) {
364366}
365367```
366368
369+ ### help
370+ Help fields is not really a field, but instead let's you inser arbitrary HTML
371+ into a form, suitable for help texts with links etc.
372+
373+ It uses ``` ng-bind-html ``` so you need to include the
374+ [ ngSanitize] ( https://docs.angularjs.org/api/ngSanitize ) module for it to work,
375+ or expicitly turning of strict contextual escaping with
376+ ``` $sceProvider.enabled(false) ``` (not recomended). It's enough to include
377+ ``` angular-sanitize.min.js ``` before ``` angular-schema.min.js ``` and Schema Form
378+ will pick up that it's there and include it as a module dependency.
379+
380+ The get a help field you need to specify the type ``` help ``` and have a html
381+ snippet as a string in the option ``` helpvalue ```
382+
383+ Ex.
384+ ``` javascript
385+ function FormCtrl ($scope ) {
386+ $scope .schema = {
387+ type: " object" ,
388+ properties: {
389+ name: {
390+ title: " Name" ,
391+ type: " string"
392+ }
393+ }
394+ };
395+
396+ $scope .form = [
397+ {
398+ type: " help" ,
399+ helpvalue: " <h1>Yo Ninja!</h1>"
400+ },
401+ " name"
402+ ];
403+ }
404+ ```
367405
368406Post process function
369407---------------------
0 commit comments