async pipe subscribe Observable/Promise, render latest value và tự unsubscribe khi view bị destroy.
Nó giảm memory leak so với subscribe thủ công trong component. Với OnPush, mỗi lần Observable emit, async pipe cũng mark component để update. Nếu cần transform nhiều stream phức tạp, xử lý trong component/service bằng RxJS rồi expose stream đã sẵn sàng cho template.
The async pipe subscribes to an Observable/Promise, renders the latest value and automatically unsubscribes when the view is destroyed.
It reduces memory leaks compared with manual subscriptions in a component. With OnPush, each Observable emission also marks the component for update. For complex stream transformations, handle them in a component/service with RxJS and expose a ready-to-render stream to the template.