ngFor

In Angular, you can use the ngFor directive to generate templates from lists. Essentially, ngFor repeats the template's element it is applied to, along with its subtree, for every item in the bound list.

The basic format with which to use ngFor is shown in the following statement:

let <variableName> of <componentData>

Note that componentData can be either a field, a property, or a function that returns a list.

This makes variableName available to the context of the template associated with ngFor directive. This is the reason you can use c.name to pass it down to the child component as input.

The asterisk you see next to ngFor is often used with structural directives. This a special construct with which Angular provides syntactic sugar over structural directives that modify the HTML DOM layout.

You can read more about the many built-in directives in Angular at https://angular.io/guide/template-syntax#built-in-directives.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.179.220