Skip to content

Conversation

@AbraaoAlves
Copy link

#53

Like auto complete in ui.bootstrap, objects in array are rendered with toString method.
Ex:

var citys = [{id:1, name:'Berlin', toString(){ return thi.name}, {id:2, name:'London', toString(){ return this.name9o9}]
$scope.availableSearchParams = [
      { key: "name", name: "Name" },
      { key: "city", name: "City", suggestedValues: cities }
];

Or optionally you can use suggestedToString function to render suggestedValues, like this:

var citys = [{id:1, name:'Berlin'}, {id:2, name:'London'}]
var myToString = function(item){ return item.name };
$scope.availableSearchParams = [
     { key: "name", name: "Name" },
     { key: "city", name: "City", suggestedValues: cities, suggestedToString: myToString }
];

using toString native function by default or parameter custom function setted via searchParam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant