Use AsyncPipe When Possible
I typically review a fair amount of Angular code at work. One thing I typically
encourage is using plain Observables in an Angular Component, and using
AsyncPipe (foo | async) from the
template html to handle subscription, rather than directly subscribing to an
observable in a component TS file.
Unless you know a subscription you’re starting in a component is very finite (e.g. an HTTP request with no retry logic, etc), subscriptions you make in a Component must:
Read more →
Syrian girls, carrying school bags provided by UNICEF, walk past the rubble of destroyed buildings on their way home from school on March 7 in al-Shaar neighborhood, in the rebel-held side of the northern Syrian city of Aleppo. by Jordi Bernabeu Farrús via Flickr
Bernie Sanders by AFGE via Flickr