Upload code:
for (var i = 1; i < 7; i++) {
var res='res'+i;
$scope.res=XXXX;
};
The variable name is composed of the string res plus i, which is res1--res6; how to connect a concatenated variable name after $scope? $scope.res i or $scope[res i] will not work
Thanks for the answer: The final answer is that you cannot click. Connect variables
$scope[res] = xxxxx;
for (var i = 1; i < 7; i++) {
}
First of all, res should be an array,
$scope.res=[];
for (var i = 1; i < 7; i++) {
$scope.res.push('res'+i);
}
Probably written like this.
$scope["res"+i] Just write it like this