iloire / watchmen

A simple node.js service monitor
MIT License
941 stars 199 forks source link

Admin settings dropdown menu automatically closes down #93

Open vishnu-kyatannawar opened 7 years ago

vishnu-kyatannawar commented 7 years ago

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"