ngFor

Angular Directives

In this Introduction to Angular Directive, we are going to look at the Angular Directives. We will look at three types of directives that Angular supports like Component, Structural and Attribute Directives. We also look at the few of the most commonly used Angular directives.

Angular Directives Read More »

Angular ngFor Directive

Angular ngFor directive iterates over a collection of data like an array, list, etc and create an HTML element for each of the items from an HTML template. It helps us to build lists or tables to display tabular data in a nice way. In this tutorial, we will look at the syntax and how to use ngFor to display a list of movies using example code. The ngFor also exports several local variables like Index, First, Last, odd, and even. We demonstrate the use of local variables by creating a simple code to Format odd & even rows of a table by assigning different classes to them. Finally, we look at the trackBy clause, which enhances the performances of the ngFor.

Angular ngFor Directive Read More »

Scroll to Top