$scope.stringArray = new Array();
angular.forEach($scope.questions, function(value, key){
if(value.type == 'select') {
var string = value.value;
console.log(string) //"This is item";
for(var i =0; i < string.length; i++){
$scope.stringArray.push(string[i]);
if(i != string.length-1){
$scope.stringArray.push(" ");
}
}
}
});
它应该返回
stringArray [0] = "This"; stringArray [1] = "is"; stringArray [2] = "item";
目前的回应就是那样
stringArray [0] = "T"; stringArray [1] = ""; stringArray [4] = "h"; stringArray [5] = ""; stringArray [6] = "i";... Please guide