Closed jaufgang closed 7 years ago
@jaufgang this is just another approach :) Do you believe that this should be a feature?
Yes I do. This would be much simpler to use by developers, who could then re-use existing functions in their component or other services without needing to have a special service just to use this component.
How do I display more than one search result today is limited to 1, but would like to limit to 3 for example?
I agree with @renanmoraes : this service thing is a lot to implement for a quite simple thing, imo...
Fixed e78f12eedb0546d3dda6cd317127b84a1917aeb9
This component is helpful but it seems unnecessarily complicated to require users to create a service that implements
AutoCompleteService
when they may have an existing function in the parent component or another service with a name that is different fromgetResults
.Why not simply allow users to pass in any callback function
Where
mySearchFn
can be any function that accepts a string argument and returns an array?Also, as I have in my above example,
labelAttribute
can be an@Input
parameter of the component instead of making it a property of a service.