acute-select icon indicating copy to clipboard operation
acute-select copied to clipboard

Works with arrays?

Open markatbdex opened this issue 11 years ago • 2 comments

Docs mention it works with arrays. Doesn't seem to. Am I missing some trick?

markatbdex avatar Oct 10 '14 19:10 markatbdex

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; };

markatbdex avatar Oct 11 '14 01:10 markatbdex

Yes, you're absolutely right - I'll incorporate that change and add a test with a simple string array!

john-oc avatar Oct 11 '14 16:10 john-oc