The quantity of elements in this code is showing as 0 even though it contains a value.
Sample snippet:
for (var q = 0; q < data.data.length; q++) {
var test1 = {
imgId: data.data.imgId,
imgString: data.data.imgString
};
vm.imgArr.push(test1);}
console.log(vm.imgArr.length); // displays zero
Example dataset:
data.data = [
{
"imgId": "asdasd21321312312asdad",
"imgString": "heasjahdasdjashdjashd"
},
{
"imgId": "asdasd21321312312asdad",
"imgString": "heasjahdasdjashdjashd"
},
{
"imgId": "asdasd21321312312asdad",
"imgString": "heasjahdasdjashdjashd"
}];