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

WEBINAR:

On-Demand

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


Watch

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">
</div>

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 ">
</div>
Srinath MS
 
Submit a Tip
Browse "Web Development" Tips
Browse All Tips
javascriptweekly.com
googlecode.com