As I am relatively new to Angular, I am seeking advice on how to create a variable inside the controller based on an array position.
So far, I have successfully declared the following variables:
$scope.chosenCategory = 1;
$scope.categoryNames = ["site", "country", "customer", "type"];
I attempted to accomplish this by using the following code snippet, however, it caused all the angular expressions in the controller's template to cease functioning:
$scope.aspect = categoryNames[chosenCategory];
The expected outcome is for the variable to display the string "country" initially.
Your assistance in solving this issue would be greatly appreciated. Thank you in advance.