title: Nested angular.forEach issue
body: <p>I am trying to loop through an array inside an array normally an easy task.  However I have never done this in angular before and it is proving to be annoying.  I am sure I am missing some understanding of the way I should do things in order to accomplish that.  The cloneMealPlan item in the scope is the one I am trying loop through specifically there is an array of meals and inside each meal an array of recipes.</p>
  
  <p>When I log to the console right in the beginning of the function it all looks fine.  However, inside the first forEach I can't access the recipes array that was in the meal. If you log the meal as a whole you can see it in the console but not when you try and reference from inside meal.</p>
  
  <p>I am also open to a better way of doing this in general essentially I need to clone a MealPlan which has quite a few layers of arrays in it (doesn't stop at recipes) I have consider moving all of this to the backend and just doing a select and insert on the node side but wasn't sure the best practice.</p>
  
  <p>For now I am sending the whole MealPlan as an object and then doing an async eachSeries on the backend sense each piece needs ids from the other.</p>
  
  <p>So my specific question is why can't I access the recipes array from inside meal forEach?</p>
  
  <pre><code>var cloneIngredientsLists = function() {
  
      console.log($scope.cloneMealPlan);
      console.log($scope.cloneMealPlan.meals);
      console.log($scope.cloneMealPlan.meals[0].recipes);
  
      angular.forEach($scope.cloneMealPlan.meals, function(meal) {
  
        console.log(meal);
        console.log(meal.recipes);
        console.log(meal.recipes.length);
  
        angular.forEach(meal.recipes, function(recipe) {
  
          console.log(recipe);
  
  
            return IngredientsListMapping
            .query({id: recipe.id})
            .$promise
            .then(function(ingredientslists) {
              $scope.ingredientslists = ingredientslists;
              if (!recipe.ingredientslists) {
                recipe.ingredientslists = [];
              }
  
              for (var k = 0; k &lt; ingredientslists.length; k++) {
  
                recipe.ingredientslists[k] = ingredientslists[k];
                recipe.ingredientslists[k].list_name = ingredientslists[k].list_name + '- Clone';
  
  
                if (!recipe.ingredientslists[k].ingredients) {
                  recipe.ingredientslists[k].ingredients = [];
                }
  
              }
  
  
            });
          });
        });
    };
  </code></pre>