Which operator can be used to automatically unsubscribe from an observable when a component is destroyed?
- "map" operator
- "subscribe" operator
- "takeUntil" operator
- "tap" operator
The "takeUntil" operator is commonly used to automatically unsubscribe from an observable when a component is destroyed. It takes an observable that emits when the component is destroyed, ensuring that the original observable is unsubscribed.
Loading...
Related Quiz
- When debugging a failing Protractor test, what tool can you use to pause the test execution and inspect the browser's state?
- To reactively listen to changes to route parameters in Angular, you should use the _____ property of the ActivatedRoute service.
- By using a custom _____ strategy, you can control which lazily-loaded modules should be preloaded in your Angular application.
- In a Protractor test, how can you interact with a button element on a webpage?
- What is the difference between the concat and merge operators when combining Observables?