gonewandering / angles

An angular.js wrapper for Chart.js
MIT License
632 stars 87 forks source link

Directives need to destroy chart when directive is destroyed #68

Open speshy opened 9 years ago

speshy commented 9 years ago

We're using ng-view in our application. Navigating to and from a view with a chart and a view without a chart I found two things happening:

The following is needed in the link function:

$scope.$on("$destroy", function(){
    if (chartCreated){
        chartCreated.destroy();
    }
});
LeleDev commented 9 years ago

+1