Currently, I am working on an AngularJS application that utilizes 7 Angular Material tabs. One issue I have encountered is a significant amount of animation lag when switching tabs or opening a md-select element. According to Chrome Developer Tools, the frame rate drops between 10-30 fps at best.
I believe this performance issue stems from the abundance of md-option
elements being generated by the ng-repeat
directive within the numerous md-selects
present throughout the application. A quick check using
document.getElementByTagName("md-option")
in the console revealed around 1000 DOM elements created for these dropdown lists.
Is there a way to enhance the speed of ng-repeat specifically within md-selects? Can md-virtual-repeat be utilized as a replacement to optimize the rendering of these dropdown menus?
In addition, all static text on the page is sourced from a language file, and I have come across the suggestion to use {{ ::variableName }}
syntax to prevent unnecessary angular watches on those models.
Further, each tab loads its HTML content through ng-include="path/to/htmlFile"
. Are there alternative methods that could improve the efficiency and loading speed here?
<md-tab ng-click="nextTab($event)" label="{{lang.tabPD}}" md-on-select="vm.tabName='tabPD'" md-no-pagination="true">
<div ng-include="'app/modules/partials/tabPD.html'" ng-controller="PDCtrl"></div>
</md-tab>
<md-tab>
...another div with ng-include
</md-tab>
etc
Any insights or recommendations you can offer would be greatly appreciated.