Created
August 16, 2016 02:39
-
-
Save hn5092/8365a85528dd6d25e0133ff36e677f41 to your computer and use it in GitHub Desktop.
angular watch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment