$rootScope.$watch('tmpChartCount', function (newValue, oldValue, isRefren) { console.log("change"); if ($rootScope.tmpChartMap.count() > 0) $rootScope.tmpChartMap.forEach(function (k, v) { $http.get(v.url).then(function (response) { v.data = response.data; v.draw(); $rootScope.chartMap.set(k, v); $rootScope.tmpChartMap.remove(k); }); }); }, true);