I am currently working on a loop where I need to populate my array called photos
:
$scope.photos = [];
var str = data.data.Photos;
var res = str.split('|');
angular.forEach(res, function (item) {
var line = {src: 'photos/'+item, desc: item};
$scope.photos.push(line);
});
However, I am encountering errors in the line
var line = {src: 'photos/'+item, desc: item};
:
Unexpected token