Angular - RxJS and Observables FundamentalsWhy does Angular prefer observables over promises for handling asynchronous data?ABecause promises are not supported in Angular.BBecause promises cannot be canceled in Angular.CBecause observables are easier to write than promises.DBecause observables can handle multiple values over time, unlike promises.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand the difference between observables and promisesObservables can emit multiple values over time, while promises resolve once with a single value.Step 2: Relate this to Angular's asynchronous needsAngular often deals with streams of data, like user inputs or HTTP events, which observables handle well.Final Answer:Because observables can handle multiple values over time, unlike promises. -> Option DQuick Check:Observable capability = B [OK]Quick Trick: Observables stream data; promises deliver once only. [OK]Common Mistakes:MISTAKESThinking promises are unsupported in AngularBelieving observables are simpler to writeConfusing cancellation abilities
Master "RxJS and Observables Fundamentals" in Angular9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Angular Quizzes HTTP Client - Setting headers and params - Quiz 2easy Reactive Forms - Form state tracking (dirty, touched, valid) - Quiz 7medium Reactive Forms - Why reactive forms are preferred - Quiz 7medium Routing - Why routing is needed for SPAs - Quiz 3easy Routing - Why routing is needed for SPAs - Quiz 7medium Routing - Route guards (canActivate, canDeactivate) - Quiz 6medium RxJS Operators - filter operator for selection - Quiz 14medium RxJS Operators - Why operators transform data streams - Quiz 9hard RxJS and Observables Fundamentals - Async pipe for template subscriptions - Quiz 14medium RxJS and Observables Fundamentals - Observable in component lifecycle - Quiz 15hard