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?
滿天的星座2017-05-16 13:21:50
Why not try the object method?
for (var w = 0; w < source.length; i++) {
$scope.chartdata[w] = rows;
}