I have a $watchgroup in angularjs in which I have two values, primaryApplicationChartData and secondaryApplicationChartData. The watchgroup gets called when both of them change.
I want to make sure that the code inside $watchgroup i.e.,drawStockChart() func gets called only once even though both chart data change.
Can anyone give some idea on how to do it?
Thanks.
scope.$watchGroup(['primaryApplicationChartData', 'secondaryApplicationChartData'], function(newValues, oldValues, scope) {
console.log("chartData has changed");
drawStockChart();
});