fix chart would not be destoried when that is unused
This commit is contained in:
parent
213b53f5ef
commit
031a8dabcc
|
@ -38,6 +38,12 @@
|
||||||
setOptions(value);
|
setOptions(value);
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
scope.$on('$destroy', function() {
|
||||||
|
if (chart && !chart.isDisposed()) {
|
||||||
|
chart.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}]).directive('ngPopChart', ['$window', 'chartTheme', function ($window, chartTheme) {
|
}]).directive('ngPopChart', ['$window', 'chartTheme', function ($window, chartTheme) {
|
||||||
|
@ -79,7 +85,7 @@
|
||||||
|
|
||||||
chart = echarts.init(wrapper[0], chartTheme.get(options.ngTheme));
|
chart = echarts.init(wrapper[0], chartTheme.get(options.ngTheme));
|
||||||
}).on('hide.bs.popover', function () {
|
}).on('hide.bs.popover', function () {
|
||||||
if (chart && chart.isDisposed()) {
|
if (chart && !chart.isDisposed()) {
|
||||||
chart.dispose();
|
chart.dispose();
|
||||||
}
|
}
|
||||||
}).on('hidden.bs.popover', function () {
|
}).on('hidden.bs.popover', function () {
|
||||||
|
|
Reference in a new issue