Skip to content

Commit e44a406

Browse files
committed
Added ngSanitize as a dependency in docs
ng-html-bind is now used by more than just the help type.
1 parent 1f32bab commit e44a406

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,15 @@ bower install angular-schema-form
7575
(or just download the contents of the ```dist/``` folder and add dependencies
7676
manually)
7777

78-
It depends on AngularJS (duh!), [tv4](https://github.com/geraintluff/tv4), and
78+
It depends on [AngularJS](https://angularjs.org/) (duh!),
79+
[angular-sanitize](https://docs.angularjs.org/api/ngSanitize),
80+
[tv4](https://github.com/geraintluff/tv4), and
7981
if you like to use the date picker you also need jQuery and
8082
[pickadate.js](http://amsul.ca/pickadate.js/). Also if you use the ```help```
8183
type to inject HTML you'll want to use ngSanitize as well.
8284

8385
The minified files also includes all templates so they are all you need.
8486

85-
8687
Addons
8788
------
8889
Currently there is only one addon, a date picker using

docs/index.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ General options most field types can handle:
147147
type: "text", //Type of field
148148
title: "Street", //Title of field, taken from schema if available
149149
notitle: false, //Set to true to hide title
150-
description: "Street name", //A description, taken from schema if available
150+
description: "Street name", //A description, taken from schema if available, can be HTML
151151
validationMessage: "Oh noes, please write a proper address", //A custom validation error message
152152
onChange: "valueChanged(form.key,modelValue)", //onChange event handler, expression or function
153153
feedback: false //inline feedback icons
@@ -300,7 +300,9 @@ scope.
300300
### select and checkboxes
301301

302302
*select* and *checkboxes* can take an object, ```titleMap```, where key is the value to be saved on the model
303-
and the value is the title of the option.
303+
and the value is the title of the option. In the case of *checkboxes* the values
304+
of the titleMap can be HTML.
305+
304306
```javascript
305307
{
306308
type: "select",
@@ -340,7 +342,7 @@ the ```sf-schema``` directive.
340342
### radios and radiobuttons
341343
Both type *radios* and *radiobuttons* work the same way, they take a titleMap
342344
and renders ordinary radio buttons or bootstrap 3 buttons inline. It's a
343-
cosmetic choice.
345+
cosmetic choice. The value in the titleMap can be HTML.
344346

345347
Ex.
346348
```javascript
@@ -369,16 +371,9 @@ function FormCtrl($scope) {
369371
```
370372

371373
### help
372-
Help fields is not really a field, but instead let's you inser arbitrary HTML
374+
Help fields is not really a field, but instead let's you insert arbitrary HTML
373375
into a form, suitable for help texts with links etc.
374376

375-
It uses ```ng-bind-html``` so you need to include the
376-
[ngSanitize](https://docs.angularjs.org/api/ngSanitize) module for it to work,
377-
or expicitly turning of strict contextual escaping with
378-
```$sceProvider.enabled(false)``` (not recomended). It's enough to include
379-
```angular-sanitize.min.js``` before ```angular-schema.min.js``` and Schema Form
380-
will pick up that it's there and include it as a module dependency.
381-
382377
The get a help field you need to specify the type ```help``` and have a html
383378
snippet as a string in the option ```helpvalue```
384379

0 commit comments

Comments
 (0)