Skip to content

Commit f09f994

Browse files
committed
Post process fn in schemaForm provider
You can now register a post process fn to add that final touch.
1 parent 0bc2c6b commit f09f994

File tree

5 files changed

+75
-10
lines changed

5 files changed

+75
-10
lines changed

README.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ function FormController($scope) {
5757
}
5858
```
5959

60+
61+
Contributing
62+
------------
63+
64+
All contributions are welcome! We're trying to use [git flow](http://danielkummer.github.io/git-flow-cheatsheet/)
65+
so please base any merge request on the **development** branch instead of **master**.
66+
67+
68+
6069
Form types
6170
----------
6271
Schema Form currently supports the following form field types:
@@ -399,8 +408,23 @@ function FormCtrl($scope) {
399408
```
400409

401410

402-
Contributing
403-
------------
411+
Post process function
412+
---------------------
404413

405-
All contributions are welcome! We're trying to use [git flow](http://danielkummer.github.io/git-flow-cheatsheet/)
406-
so please base any merge request on the **development** branch instead of **master**.
414+
If you like to use ```["*"]``` as a form, or aren't in control of the form definitions
415+
but really need to change or add something you can register a *post process*
416+
function with the ```schemaForm``` service provider. The post process function
417+
gets one argument, the final form merged with the defaults from the schema just
418+
before it's rendered, and should return a form.
419+
420+
Ex. Reverse all forms
421+
```javascript
422+
angular.module('myModule').config(function(schemaFormProvider){
423+
424+
schemaForm.postProcess(function(form){
425+
form.reverse();
426+
return form;
427+
})
428+
429+
});
430+
```

dist/bootstrap-decorator.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)