Interview Questions For Angular Developer PDF
Interview Questions For Angular Developer PDF
Answer:
Modules
Components
Templates
MetaData
Data-Binding
Directives
Services
Dependency Injection
Answer:
If the URL doesn't match any predefined routes then it causes the router to throw an error and
crash the app. In this case, you can use wildcard route. A wildcard route has a path consisting of
two asterisks to match every URL.
For example, you can define PageNotFoundComponent for wildcard route as below
Q3. What modules should you import in Angular to use [(ngModel)] and reactive forms?
Answer:
Answer:
Transpiling means converting the source code of one programming language into another. In
Angular, that usually means converting TypeScript into JavaScript. You can write the code for
your Angular application in TypeScript (or another language such as Dart) that is then transpiled
to JavaScript for the application. This happens internally and automatically.
Answer:
There are two strategies – Default and OnPush. If all components use the default strategy, Zone
checks the entire tree regardless of where the change occurred. To inform Angular that we will
comply with the performance improvement conditions, we need to use the onpush change
detection strategy. This will tell Angular that our component depends only on the input and any
object that is passed to it should be considered immutable. This is all built on the Principle of
the mile automaton, where the current state depends only on the input values.
Answer:
The process of monitoring the watchlist in order to track changes in the value of the watch
variable is termed the digest cycle in Angular. The previous and present versions of the scope
model values are compared in each digest cycle.
Although the digest cycle process gets triggered implicitly, it is possible to start it manually by
using the $apply() function.
Answer:
As soon as a promise is made, the execution takes place. However, this is not the case with
observables because they are lazy. This means that nothing happens until a subscription is
made. While promises handle a single event, observable is a stream that allows passing of more
than one event. A callback is made for each event in an observable.