I have a multiselect field in angular-formly, with the following options:
vm.fields = [
{
key: 'fruits',
type: 'multiCheckbox',
className: 'multi-check',
templateOptions: {
label: 'Fruits:',
options: [
{
"name": "ALL",
"value":"ALL"
},
{
"name": "apple",
"value":"apple"
},
{
"name": "orange",
"value":"orange"
},
{
"name": "pear",
"value":"pear"
},
{
"name": "blueberry",
"value":"blueberry"
},
],
},
},
];
When I select/unselect "ALL", I want all the options to be selected/unselected. For Example. If ALL is checked, then all the fruits options( apple, orange, pear, blueberry) should be checked as well
If I unselect ALL, then none of the fruit options should be checked.
How do I enable this behavior in angular-formly?
Here is the link to jsbin: https://jsbin.com/xololi/edit?html,js,output