Can angular variable names be dynamically generated?
For example, like this
for (var w = 0; w < source.length; i++) {
($scope.chartdata + w) = rows;
}
I want to dynamically generate the variable name on the left, but it doesn’t seem to work. Does anyone have a good way to solve dynamic naming?
$scope["chartdata"+w] = rows;
Why not try the object method?