Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro is JavaScript
Message
 
 
To
All
General information
Forum:
Javascript
Category:
Other
Title:
Macro is JavaScript
Miscellaneous
Thread ID:
01615034
Message ID:
01615034
Views:
51
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
Next
Reply
Map
View

Click here to load this message in the networking platform