How can I generate cases using $scope.type[i] (a JSON array from the database)?
$scope.type = [{nomcarac: "phone"}, {nomcarac: "shoes"}];
$scope.getValuesList = function(item) {
switch (item.type){
case 'phone':
item.valuelist = angular.copy($scope.phonelist);
break;
case 'shoes':
item.valuelist = angular.copy($scope.shoeslist);
break;
default:
item.valuelist = [];
break;
}
};