@@ -16,6 +16,7 @@ Documentation
16
16
1 . [ actions] ( #actions )
17
17
1 . [ button] ( #button )
18
18
1 . [ radios and radiobuttons] ( #radios-and-radiobuttons )
19
+ 1 . [ help] ( #help )
19
20
1 . [ Post process function] ( #post-process-function )
20
21
21
22
Form types
@@ -38,6 +39,7 @@ Schema Form currently supports the following form field types out of the box:
38
39
| button | a button |
39
40
| radios | radio buttons |
40
41
| radiobuttons | radio buttons with bootstrap buttons |
42
+ | help | insert arbitrary html |
41
43
42
44
More field types can be added, for instance a "datepicker" type can be added by
43
45
including the [ datepicker addon] ( datepicker.md )
@@ -364,6 +366,42 @@ function FormCtrl($scope) {
364
366
}
365
367
```
366
368
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
+ ```
367
405
368
406
Post process function
369
407
---------------------
0 commit comments