for ( var i = 0; i < members.length; i++ ) {
var value = value[i];
console.log(value);
}
Feeling really bewildered by how this could be incorrect...
'i' is set to zero, so it's perplexing how the value couldn't be found.
Here is all of my controller code:
angular.module(module.name).controller(module.name + '.c.' + current.name, [
'$scope',
'$stateParams',
'members',
'assessment',
'$localStorage',
function (scope, stateParams, members, assessment, $localStorage) {
scope.members = members;
// Assessment and item scope variables
scope.assessment = assessment;
scope.active = $localStorage.$default({
value : false
});
console.log(members.length);
// Currently, this function only logs messages
scope.change = function (active) {
if (active) {
scope.active = $localStorage.$default({
value : true
});
console.log('hi 1');
} else {
scope.active = $localStorage.$default({
value : false
});
console.log('hi 2');
}
};
for ( var i = 0; i < members.length; i++ ) {
var value = value[i];
console.log(value);
}
}
]);
UPDATE
This is what I was aiming for:
for ( var i = 0; i < members.length; i++ ) {
value = "value" + i;
console.log(value);
}