This repository was archived by the owner on Apr 30, 2018. It is now read-only.
This repository was archived by the owner on Apr 30, 2018. It is now read-only.
Multicheckbow is not working with JSON objects #91
Open

Description
Issue similar to #88
I fixed it in
angular-formly-templates-bootstrap/src/types/multiCheckbox.js
Lines 36 to 42 in 26ec0f5
replacing
$scope.multiCheckbox.checked[index] = modelValue.indexOf(newOptionsValues[index][valueProp]) !== -1;
by
$scope.multiCheckbox.checked[index] = modelValue.map(function(t){return t[valueProp];}).indexOf(newOptionsValues[index][valueProp]) !== -1;
And in the setModel function
function setModel() {
$scope.model[opts.key] = [];
angular.forEach($scope.multiCheckbox.checked, function (checkbox, index) {
if (checkbox) {
$scope.model[opts.key].push(to.options[index]);
}
});
Metadata
Metadata
Assignees
Labels
No labels