#SearchInputBox guestion
4 messages · Page 1 of 1 (latest)
Please take some time to re-read your questions before posting.
It's really hard to read them.
Do you want the search box to automatically trigger an operation (probably a GET request) after every keystroke but only if the user has put in at least 3 characters?
You can make it really easy leveraging ReactiveForms.
- bind that input to a
FormControl - subscribe to its
valueChangesobservable - pipe to a filter checking
value.length > 2 - switchMap to the http request
- do what you want with emitted value
You don't need flags and other strange things.
And you can even refine its behaviour adding some debounce to avoid cloggin the network with many requests