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

Admin settings dropdown menu automatically closes down #93

@vishnu-kyatannawar

Description

@vishnu-kyatannawar

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions