First of all - thanks for great ui component, this is probably best multi-select component I've ever seen (been developing for 15+ years).
I was wondering if it would be possible to add output-model-property that would determine how output-model gets populated. Currently, whole objects get cloned into output-model, i.e:
$scope.inputList = [
{ id: 0, firstName: "Peter", lastName: "Parker", pic: "<img src='[...]/peter.png class='multiSelect' />", selected: false },
{ id: 1, firstName: "Mary", lastName: "Jane", pic: "<img src='[...]/mary.png class='multiSelect' />", selected: false },
{ id: 2, firstName: "Bruce", lastName: "Wayne", pic: "<img src='[...]/bruce.png class='multiSelect' />", selected: true },
{ id: 3, firstName: "David", lastName: "Banner", pic: "<img src='[...]/david.png class='multiSelect' />", selected: false },
{ id: 4, firstName: "Natalia", lastName: "Romanova", pic: "<img src='[...]/natalia.png class='multiSelect' />", selected: false },
{ id: 5, firstName: "Clark", lastName: "Kent", pic: "<img src='[...]/clark.png class='multiSelect' />", selected: true }
];
$scope.outputList = [
{ id: 2, firstName: "Bruce", lastName: "Wayne", pic: "<img src='[...]/bruce.png class='multiSelect' />", selected: true },
{ id: 5, firstName: "Clark", lastName: "Kent", pic: "<img src='[...]/clark.png class='multiSelect' />", selected: true }
];
What I would like is if it was possible to specify output-model-property="id" and then output list would be:
$scope.outputList = [
2,
5
];
Reason being - most dropdowns/comboboxes are bound to some unique IDs, and something like this would allow to avoid using angular.forEach(param, function(value,key) { ... }) every time you need to fetch what's selected.
If you want to preserve selected states across pages, you can simply pass selected ids in querystring (like ?States=JSON.stringify($scope.outputList))
You can bind $scope.outputList to and use that as part of the
...
For some crazy scenarios it would be great if this was possible to do with multiple properties (like item-label="icon name maker", although this would change format from [2,5] to [{id:2,name:Do},{id:5,name:La}]), but even one property for start would be great to save us from doing angular.forEach every time we need to get selected values.
Regardless of what you decide to do about this - thanks again for great component.