function addFoodToDietPlan() {
  // If diet plan has been created, add item
  if (app.dietPlanList.dietName === "") {
    return;
  } else {
    food = JSON.parse(JSON.stringify(this.food));

    app.dietTotalsList.calories += food.calories;
    app.dietTotalsList.carbs += food.carbs;
    app.dietTotalsList.fat += food.fat;
    app.dietTotalsList.protein += food.protein;

    app.dietPlanList.foods.push(food);
  }
}
// Adds a food item to a diet plan
Adds a food item to a diet plan
Adds a food item to a diet plan
function addFoodToDietPlan() {
  if (app.dietPlanList.dietName === "") {
    return;
  } else {
    food = JSON.parse(JSON.stringify(this.food));
    app.dietTotalsList.calories += food.calories;
    app.dietTotalsList.carbs += food.carbs;
    app.dietTotalsList.fat += food.fat;
    app.dietTotalsList.protein += food.protein;
    app.dietPlanList.foods.push(food);
  }
}
function addFoodToDietPlan ( ) { if ( app . dietPlanList . dietName === "" ) { return ; } else { food = JSON . parse ( JSON . stringify ( this . food ) ) ; app . dietTotalsList . calories += food . calories ; app . dietTotalsList . carbs += food . carbs ; app . dietTotalsList . fat += food . fat ; app . dietTotalsList . protein += food . protein ; app . dietPlanList . foods . push ( food ) ; } }
Adds a food item to a diet plan
Adds a food item to a diet plan
// If diet plan has been created, add item