Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro is JavaScript
Message
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Macro is JavaScript
Divers
Thread ID:
01615034
Message ID:
01615034
Vues:
50
Hi everybody,

I have the following code (for 6 values of the indexes):
if (index === 1) {
                        $scope.currentTemplate.aAutoDep1 = '';
                        $scope.currentTemplate.aAutoItm1 = '';
                        $scope.currentTemplate.aAutoCat1Hashed = null;
                        $scope.currentTemplate.aAutoCat1 = '';
                    } else if (index === 2) {
                        $scope.currentTemplate.aAutoDep2 = '';
                        $scope.currentTemplate.aAutoItm2 = '';
                        $scope.currentTemplate.aAutoCat2Hashed = null;
                        $scope.currentTemplate.aAutoCat2 = '';
Is there a way to write it in a simpler manner without 6 different cases?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform