How to avoid memory leaks using angularjs-nvd3-directives

后端 未结 3 861
闹比i
闹比i 2021-02-04 08:43

I\'m working on an angularjs application using angularjs-nvd3-directives to render charts.

After a check with Chrome Developer Tools, I detected some memory leaks linked

3条回答
  •  孤街浪徒
    2021-02-04 09:24

    There is a similar issue at the github: https://github.com/cmaurer/angularjs-nvd3-directives/issues/193

    As I explained there the following worked better:

      $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
    angular.element(document.body.querySelectorAll('.nvd3')).remove();
    

    This solves the SVG memory leaks. But still there are some memory leaks on the data side (Array).

提交回复
热议问题