Explain the difference between promise and observable in angular?
Answer / Vishesh Bahadur Srivastav
In Angular, a Promise is a JavaScript object that represents the eventual completion or failure of an asynchronous operation. It has a `then` method for handling the resolved value and a `catch` method for handling errors. An Observable, on the other hand, is a stream of data that can be asynchronously emitted over time. Observables have various operators (such as `map`, `filter`, and `concat`) to manipulate the stream of data and a subscription mechanism to listen for changes.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is $location in angularjs?
Explain ng-controller directive angularjs?
What are angularjs modules?
What is $emit, $broadcast and $on in AngularJS?
How would you select a custom component to style it?
What are the new features in angular 8?
What is the factory method in angularjs?
What are the concept of scope hierarchy? Tell me how many scope can an application have?
What is eventemitter angular2?
What is class binding in angular?
What is patchvalue used for?
How can you create a decorator in angular?