Angular Interview Questions | Eklavya Online

Angular Interview Questions

What is interpolation in Angular?

Angular is a convenient alternative to property binding. It is a special syntax that Angular converts into property binding. Interpolation is represented by double curly braces ({{}}). The text between the curly braces is often the name of a component property. Angular replaces that name with the string value of the corresponding component property.

What is the use of ngIf directive?

Angular ngIf directive is used when you want to display a view or a portion of a view only under specific circumstances. The Angular ngIf directive is used to insert or remove an element according to the true/false condition.

What is dependency injection (DI) in Angular?

Dependency injection (DI) is an important application design pattern. In DI, a class asks for dependencies from external sources rather than creating them itself. Angular has its own dependency injection framework to resolve dependencies. So, your services depend on other services throughout your application.

What is a service in Angular?

In Angular, services are used to provide a common functionality to various modules. A service provides better modularity for your app by allowing you to extract common functionality out of components. Let’s see how to create a service which can be used across multiple components. Here, service name is EgService.

What is AngularJS Expression?

AngularJS expressions are written inside double braces {{ expressions }} or inside a directive: ng-bind=”expression”. AngularJS expressions are like JavaScript expressions which can contain literals, operators, and variables.

What is the difference between Angular and React?

Angular and React both are related to JavaScript but there are a lot of differences between them. See the main differences between Angular and React: Angular is a JavaScript framework while React is a JavaScript library. Angular is written in TypeScript while React is written in JavaScript. Angular is developed and maintained by Google while …

What is the difference between Angular and React? Read More »

What is compilation in Angular? What types of compilations are used in Angular?

The Angular applications are written in TypeScript and HTML. Their components and templates must be converted to executable JavaScript by the Angular compiler. There are two types of compilations in Angular: Just-in-time (JIT) compilation: This is a standard development approach which compiles our Typescript and html files in the browser at runtime, as the application …

What is compilation in Angular? What types of compilations are used in Angular? Read More »