Angular & RxJS Tips #4: HttpClient & Reactive Forms

preview_player
Показать описание
A new short video to show how to use #angular Reactive Forms with #rxjs operators:
for example it can be useful to create autosuggest components in 4 lines of code, making a server side call with filters and debounce.

----
Follow me on:
Рекомендации по теме
Комментарии
Автор

Question: when you use valueschanges then you need to unsubscribe on destroy, correct ?

cubasia
Автор

Hello, you can improve your function, add distinctUntilChanged() after debounceTime function, This function will not run http with same string in order, (is stupid have twice request with same value in order) . And in switchMap or after SwitchMap is not bad idea to write function startWith([]) , empty array. this automatic set empty array in case when is emptysearch string or no match from http response

jakubtomas
Автор

In these videos I don't need 2x speed... ;) well played!

leonardomattevi