Home » Tip Bank » Web Development
  • Comment on this Article
Jan 1, 2019
  • facebook
  • twitter
  • google+
  • in
  • Email



Building the Right Environment to Support AI, Machine Learning and Deep Learning


Optimize ng-repeat with the Track by Feature in Angular

Take a look at the following ng-repeat code example:

<div ng-repeat="order in orders">

This is inefficient, as the DOM is rendered every time the list is written to the page. Add the track by feature, as shown below, by allowing the code to specify the id key instead of creating random ones and slowing the process.

<div ng-repeat="order in orders track by order.orderid ">
Srinath MS
Submit a Tip
Browse "Web Development" Tips
Browse All Tips