Which is the cleanest way to consume an observable in a template?
- A Subscribing in ngOnInit and assigning to a field
- B Using the async pipe
- C Using toPromise()
- D Calling subscribe in the template
Answer
Using the async pipe
The async pipe subscribes and unsubscribes automatically and works correctly with OnPush change detection.





