My for loop with nested arrays is working fine, but it should display two strings and only shows the last one.
for (i = 0; i < $scope.taskGroups.length; i++) {
for (j = 0; j < $scope.taskGroups[i].tasks.length; j++) {
$scope.mandatories = $scope.taskGroups[i].tasks[j].mandatory;
if ($scope.mandatories === true) {
$scope.display =$scope.taskGroups[i].tasks[j].name
console.log($scope.display);
}
}
}
Console log:
routes_init.js:60 Destaques extra linear
routes_init.js:60 Equipamentos de frio