Hi,
Is there any way to pass the configuration (including binding) through a single directive?
Instead of having half the settings in the html page and angular controller, eg.
<input ej-dropdownlist
e-dataSource="vm.dropDownOptions.dataSource"
e-fields="vm.dropDownOptions.fields"
e-value="vm.dropDownOptions.value"
e-enablePopupResize="true"
e-enableFilterSearch="true"
e-filterType="contains"
/>
You specify, eg.
<input ej-dropdownlist="vm.dropDownOptions" />
And any angular binding requires you to pass it in a bindingOptions object in the configuration object, so it'd look something like this in the controller file:
vm.dropDownOptions = {
enablePopupResize=true,
enableFilterSearch=true,
filterType="contains"
bindingOptions: {
fields: 'vm.myDropDownObj.fields',
value: 'vm.myDropDownObj.value'
}
};
This is something DevExpress does similarly, which I find safer than duplicating my properties or splitting configuration across two files.