ngFor with Angular 2 and TypeScript
ngFor is a repeater directive
which outputs a list of elements by iterating over an array.
In the text below, when you see a word or phrase, click on it to highlight the source code.
Also, take a look at the IDE style to see this tutorial in wide-screen mode. You can always switch back using the Style link at the top of the page.
In the code snippet below we use the
even value too.
In the second
first value as you would expect.
Here is the output from this component.
To learn more about the other built-in directives, take a look at these tutorials.