Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Admin settings dropdown menu automatically closes down #93

Open
vishnu-kyatannawar opened this issue Jun 10, 2017 · 0 comments
Open

Admin settings dropdown menu automatically closes down #93

vishnu-kyatannawar opened this issue Jun 10, 2017 · 0 comments

Comments

@vishnu-kyatannawar
Copy link

If we click on the admin settings icon the drop-down menu appears and disappears.

Noticed that this happens only when the DOM is rerendered after every service call (/api/report/services).

Whenever there are new services It would cause ngRepeat to remove all elements of existing services and create them again, which might be expensive. That means a lot of DOM operations.

Track by to the rescue in Angular 1.2 a new addition was made to the syntax of ngRepeat: the amazingly awesome track by clause. It allows you to specify your own key for ngRepeat to identify objects by, instead of just generating unique IDs.

Required change
ng-repeat="row in $data | filter:serviceFilter track by row.service.id"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant