0% found this document useful (0 votes)
110 views

Interview Questions For Angular Developer PDF

The key parts of the Angular 8 architecture include modules, components, templates, metadata, data binding, directives, services, and dependency injection. A wildcard route matches any URL and can be used to define a PageNotFoundComponent. FormsModule and ReactiveFormsModule must be imported to use two-way binding and reactive forms. Transpiling converts code like TypeScript to JavaScript. The two change detection strategies are default and OnPush. Observables differ from promises in that observables are lazy and handle multiple events through callbacks, while promises immediately execute and only handle a single event.

Uploaded by

Vilas Pawar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views

Interview Questions For Angular Developer PDF

The key parts of the Angular 8 architecture include modules, components, templates, metadata, data binding, directives, services, and dependency injection. A wildcard route matches any URL and can be used to define a PageNotFoundComponent. FormsModule and ReactiveFormsModule must be imported to use two-way binding and reactive forms. Transpiling converts code like TypeScript to JavaScript. The two change detection strategies are default and OnPush. Observables differ from promises in that observables are lazy and handle multiple events through callbacks, while promises immediately execute and only handle a single event.

Uploaded by

Vilas Pawar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Interview Questions for Angular Developer

Q1 .What are the key parts of Angular 8 architecture?

Answer:

The key parts of the Angular 8 Architecture are as follows:

Modules

Components

Templates

MetaData

Data-Binding

Directives

Services

Dependency Injection

Q2. What is the purpose of Wildcard route?

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

{ path: '**', component: PageNotFoundComponent

Q3. What modules should you import in Angular to use [(ngModel)] and reactive forms?

Answer:

FormsModule and Reactiveforms Module.


Q4. What is Transpiling in Angular?

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.

Q5. What change detection strategies do you know?

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.

Q6. Please explain the digest cycle in Angular?

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.

Q7. How do Observables differ from Promises?

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.

You might also like