Top 10 #Angular8 and angular#9 #Interview Questions and #Answers to Know in #2020
Top 10 Angular 8/9 Interview Questions and Answers to Know in 2020
Q1:- difference between Promise and Observable in Angular?
Ans: - Promises:
return a single value
not cancellable
more readable code with try/catch and async/await
Observables:
work with multiple values over time
cancellable
support map, filter, reduce and similar operators
use Reactive Extensions (RxJS)
an array whose items arrive asynchronously over time
Q2:- What is AOT (Ahead-Of-Time) Compilation?
Ans: - Each Angular app gets compiled internally. The Angular compiler takes in the JS code, compiles it and then produces some JS code. This happens only once per occasion per user. It is known as AOT (Ahead-Of-Time) compilation.
Q3:- What is ngOnInit ()? How to define it?
Comments
Post a Comment