Is it possible to achieve something along the lines of this
var count = 1;
var blah = $scope.someThing_ + count;
So that blah would be equal to
$scope.someThing_1
I feel like this should work, but it does not seem to be working!
Thanks :)
Is it possible to achieve something along the lines of this
var count = 1;
var blah = $scope.someThing_ + count;
So that blah would be equal to
$scope.someThing_1
I feel like this should work, but it does not seem to be working!
Thanks :)
I'm not sure that it is good idea to store data with dynamically created names of variables, but if you really need in it you could work with properties in js also in this way:
$scope["property_name"]
It means that you could save some value with counter like that:
$scope["someThing_" + count] = "value"