acute-select
acute-select copied to clipboard
Works with arrays?
Docs mention it works with arrays. Doesn't seem to. Am I missing some trick?
I think I found the solution for this. Addd the undefined comparison here.
$scope.getItemFromDataItem = function(dataItem, itemIndex) { var item = null; if (dataItem !== null){ if (($scope.textField === null || $scope.textField == undefined) && typeof dataItem === 'string') { item = { "text": dataItem, "value": dataItem, "index": itemIndex }; } else if (dataItem[$scope.textField]) { item = { "text": dataItem[$scope.textField], "value": dataItem, "index": itemIndex }; } } return item; };
Yes, you're absolutely right - I'll incorporate that change and add a test with a simple string array!