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
我想大声告诉你2017-05-15 16:57:12
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.