Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/services/schema-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,14 @@ angular.module('schemaForm').provider('schemaForm',

// Special case: checkbox
// Since have to ternary state we need a default
if (obj.type === 'checkbox' && angular.isUndefined(obj.schema['default'])) {
obj.schema['default'] = false;
if (obj.type === 'checkbox') {
// Check for schema property, as the checkbox may be part of the explicitly defined form
if (obj.schema === undefined) {
obj.schema = { default: false };
}
else if (obj.schema['default'] === undefined) {
obj.schema['default'] = false;
}
}

// Special case: template type with tempplateUrl that's needs to be loaded before rendering
Expand Down