Destroy chartjs object on directive destroy

Hi,

Please check if this works for you as well.

I had problems when using the directive in a partial that was closed - then resize events would keep flooding to handle the now undefined chart.

br
Lars
sorry for that - sopy'n'paste

I'll be better next time

On Fri, Nov 14, 2014 at 11:37 PM, Carl Craig <notifications@github.com>
wrote:

> In src/tc-angular-chartjs.js:
>
> > @@ -83,6 +83,12 @@
> >            }
> >          }
> >
> > +        $scope.$on('$destroy', function() {
> > +          if ( chartObj ) {
> > +            chartObj.destroy();
> > +          }
> > +        }
>
> I think this needs to be });
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/carlcraig/tc-angular-chartjs/pull/22/files#r20391815>.
>