Angular Js 5 Interview Questions

Angular Js is the most widely used web development framework which can be used potentially for mobile apps and desktop applications development. Especially it can be used for Hybrid (Cross Platform) mobile application development. It is developed by the Google developer team. Day by day it’s updating its version. 1,2,4,5,6.. on going.
Here you can get all type of questions which is frequently asked by Top MNC. Make sure before going to interview just brush up it once.

What Is AngularJS 5?

Its an advanced version of angular 4 which have some modified features.
Angular Team keeps trying to update this angular js. Angular 5 is released on Oct 2017.
It a nothing but a typescript library which makes specially develop mobile apps and desktop applications.

What are the additional features in angular js 5

1. Build-optimizer.
2. Compiler Improvements( Make AOT the default )
3. Angular Universal State Transfer
4. New Router Lifecycle Events
5. HttpClient
6. Improvement on XSRF Protection
7. Remove *.ngfactory.ts files
8. Type checking in templates
9. AppShell
10.Preserve Whitespace

How to update httpclient in Angular js 5?

You update the HTTPClient in 3 easy steps:
1. Replace HttpModule with Http Client Module from @angular/common/http.
2. Inject the HttpClient service
3. Remove any map(res =>res.json()) calls, which are not required anymore.

What is the Built Optimizer in Angular js 5 ?

Objective of Built Optimizer is to reduce size of the bundle to make better performance.
Its make smaller size of typescript file as well.

How Preserve Whitespace in Angular 5?

In the previous version there is no restriction for whitespace, tabs while creating a build, It comes unnecessarily. In angular 5 has the restrictions. just have a look below examples
Example: If you want to restrict from homepage component, then.


Example :
If you want to restrict from globally throughout the application then need to set piece of code in config.json file.

What is the life cycle event in angular 5?

In angular 5 updated 4 kinds of the event for Guards and Resolve.
1) GuardsCheckStart,
2) Guards checked,
3) ResolveStart and
4) resolved

What are the performance level updations in angular 5?

1. It uses addEventListener for faster rendering.
2. Remove decorator DSL
3. Switch Angular to use Static-Injector instead of Reflective-Injector
4. Improvements on Lazy loading for Angular.
5. Improved Universal & AppShell Support in the CLI
6. UpdateOn Blur / Submit

What is i18N Pipes in Angular 5?

The i18n pipes that set of built-in functionality makes internationalization or changes based on the location of the date, number, currency. etc.

What is AOT in angular 5?

It stands for Ahead-of-Time. It’s a compiler which converts HTML and TypeScript code into executable JavaScript code during the build.

What is Just-in-Time (JIT) in angular 5?

It’s a compiler which converts HTML and TypeScript code into executable JavaScript code at runtime.

Why Compile with AOT is better in angular 5?

  1. Faster rendering
  2. Fewer asynchronous requests
  3. Smaller Angular framework download size
  4. Detect template errors earlier
  5. Better security

What are the security principle should be implemented at the time of app building in angular 5?

1. Never use directly DOM APIs.
2. Enable Content Security Policy (CSP)
3. Preventing CSRF or XSRF attacks.
4. Use DOM Sanitizer.
5. Use the offline template compiler