Closed FarSeeing closed 9 years ago
Hi @FarSeeing,
Thanks for looking through the code and finding some improvements. I have implemented some of your suggestions in commit c0a488f0ab8d18afea653f24e371c2d14bbad2ad and released in v0.6.8. I did a slightly premature release to get some other bug fixes in for other people and I am currently pressed for time.
$scope.visible
is true
and exit early otherwise, DONE$scope.contains
to use native contains method. Check for performance test DONE$scope.$apply()
? If $scope.$apply()
is removed then the element is not hidden properly. Do you know a way around this?$destroy
event to remove click event listeners, DONEThe improvements I have made should drastically reduce the number of $digest
calls. Hopefully this will fix your problems. If so, can you close the ticket, otherwise I will implement them when I get the time.
Thanks for your reply.
You are right about $scope.$apply
- I missed that click
event listener is fired from non-Angular environment. So there's no other way but to call $scope.$apply
.
I guess this issue is solved unless some new ideas arise.
Thank you.
We have a problem of numerous
$rootScope.$digest
calls that results of calling all watchers of all scopes. This happens because we have several instances of color picker on the same page, each one of them adding an event handler for all clicks on the whole document:What I see that could be improved:
$scope.visible
istrue
and exit early otherwise,$scope.contains
to use native contains method. Check for performance test$scope.$apply()
?$destroy
event to remove click event listeners,Thank you.