@@ -76,6 +76,7 @@ export default function() {
76
76
this . $get = function ( ) {
77
77
78
78
var service = { } ;
79
+ var typeDefault = this . defaults ;
79
80
80
81
service . merge = function ( schema , form , ignore , options , readonly , asyncTemplates ) {
81
82
form = form || [ '*' ] ;
@@ -84,7 +85,7 @@ export default function() {
84
85
// Get readonly from root object
85
86
readonly = readonly || schema . readonly || schema . readOnly ;
86
87
87
- const stdForm = schemaDefaults . defaultForm ( schema , defaults , ignore , options ) ;
88
+ const stdForm = schemaDefaults . defaultForm ( schema , typeDefault , ignore , options ) ;
88
89
89
90
//simple case, we have a "*", just put the stdForm there
90
91
var idx = form . indexOf ( '*' ) ;
@@ -104,7 +105,14 @@ export default function() {
104
105
* Create form defaults from schema
105
106
*/
106
107
service . defaults = schemaDefaults . defaultForm ;
108
+
107
109
//Utility functions
110
+ /**
111
+ * Form defaults for schema by type
112
+ * As a form is generated from a schema these are the definitions of each json-schema type
113
+ */
114
+ service . typeDefault = typeDefault ;
115
+
108
116
/**
109
117
* Traverse a schema, applying a function(schema,path) on every sub schema
110
118
* i.e. every property of an object.
0 commit comments