Skip to content

Commit d98d9cd

Browse files
committed
Resolved a stupid error with setting checklist models to empty during compile
Resolves GitHub issue #1 Signed-off-by: Daniel Hunsaker <[email protected]>
1 parent 6acd327 commit d98d9cd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dynamic-forms.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* DynamicForms - Build Forms in AngularJS From Nothing But JSON
3-
* @version v0.0.0 - 2013-09-24
3+
* @version v0.0.1 - 2014-03-13
44
* @link http://bitbucket.org/danhunsaker/angular-dynamic-forms
55
* @license LGPLv3+, http://www.gnu.org/licenses/lgpl-3.0.en.html
66
*/
@@ -134,7 +134,7 @@ angular.module('dynform', [])
134134
else if (field.type === 'checklist') {
135135
if (angular.isDefined(field.val)) {model[field.model] = angular.copy(field.val);}
136136
if (angular.isDefined(field.options)) {
137-
model[field.model] = {};
137+
if ( ! (angular.isDefined(model[field.model]) && angular.isObject(model[field.model]))) {model[field.model] = {};}
138138
angular.forEach(field.options, function (option, childId) {
139139
newChild = angular.element('<input type="checkbox" />');
140140
newChild.attr('name', field.model + '.' + childId);
@@ -469,4 +469,4 @@ angular.module('dynform', [])
469469
};
470470
}]);
471471

472-
/* End of dynamic-forms.js */
472+
/* End of dynamic-forms.js */

0 commit comments

Comments
 (0)