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. In … Read more

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. The ngIf directive in Angular is used to conditionally render or remove an element or a … Read more

What is the use of ngFor directive in Angular?

Angular ngFor directive is used in a template to display each item in a list. For example, here we iterate over list of users, {{ user }} The user variable in the ngFor double-quoted instruction is a template input variable. The ngFor directive in Angular is used for rendering lists of data by iterating over … Read more

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. In Angular, Dependency Injection (DI) is a design pattern used to … Read more

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. In Angular, a service is … Read more