Let's say that we have data in array e.g tasks = ['task 5', 'task 4', 'task 3', 'task 2', 'task 1']. Now when we will use ngFor then it will display the data like this: *ngFor="let task of tasks; let i = index" Task #{{i}}: {{task}} Output: Task 0: task 5 Task 1: task 4 Task 2: task 3 Task 3: task 2 Task 4: task 1 But we want to reverse the order of only the index. In order to do that in ts file of the angular components, define a veriable named as totalTasks: number. Now make it...
forward
Recent Posts
Categories
- Angular
- Artificial Intelligence
- C Programming
- Data Science
- Digital Pakistan
- GraphQL
- Gutenberg Block Development
- HTML
- Java Programming
- JavaScript
- Learn Angular 9 From Scratch
- Learn GraphQL
- Learn JavaScript
- Learn NextJS
- Learn TypeScript
- MEAN Stack
- MongoDB
- NextJS
- NodeJS
- Online Marketing
- PHP
- R Programming
- React
- Research Methodologies
- Search Engine Optimization
- Short Notes
- Social Media
- TypeScript
- Web Tools and Technologies
- Weebly Apps
- Weebly Development
- Wix Development
- Wordpress Development
- WordPress News
- WordPress Plugin Development
Recent Comments