You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,6 +208,14 @@
208
208
|200|[What is the purpose of hidden property?](#what-is-the-purpose-of-hidden-property)|
209
209
|201|[What is the difference between ngIf and hidden property?](#what-is-the-difference-between-ngif-and-hidden-property)|
210
210
|202|[What is slice pipe?](#what-is-slice-pipe)|
211
+
|203|[What is index property in ngFor directive?](#what-is-index-property-in-ngfor-directive)|
212
+
|204|[What is the purpose of ngFor trackBy?](#what-is-the-purpose-of-ngfor-trackby)|
213
+
|205|[](#)|
214
+
|206|[](#)|
215
+
|207|[](#)|
216
+
|208|[](#)|
217
+
|209|[](#)|
218
+
|210|[](#)|
211
219
212
220
1.### What is Angular Framework?
213
221
@@ -3069,4 +3077,40 @@
3069
3077
}
3070
3078
```
3071
3079
3080
+
**[⬆ Back to Top](#table-of-contents)**
3081
+
3082
+
203. ### What is index property in ngFor directive?
3083
+
The index property of the NgFor directive is used to return the zero-based index of the item in each iteration. You can capture the index in a template input variable and use it in the template. For example, you can capture the index in a variable named indexVar and displays it with the todo's name using ngFor directive as below.
3084
+
```javascript
3085
+
<div *ngFor="let todo of todos; let i=index">{{i + 1}} - {{todo.name}}</div>
0 commit comments