<commit_before>'use strict';
angular.module('Trendicity')

.controller('FavoritesCtrl', function(
  $scope,
  $state,
  FavoritesService,
  $ionicModal,
  $ionicSideMenuDelegate
) {
  // Initialize variables needed for view
  $scope.favorite = {};
  $scope.favorites = FavoritesService.getFavorites();

  // Enable Menu Dragging
  $scope.$on('$ionicView.enter', function() {
    $ionicSideMenuDelegate.canDragContent(true);
  });

  // Add a new favorite using the service
  $scope.addFavorite = function(favorite) {
    FavoritesService.add(favorite).then(function (data) {
      $scope.favorites = FavoritesService.getFavorites();
      $scope.closeAddFavoriteForm();
    });
  };

  // Delete a favorite using the service and update scope var
  $scope.removeFavorite = function (favorite) {
    $scope.favorites = FavoritesService.delete(favorite);
  };

  // Favorite creation modal template and helper functions
  $ionicModal.fromTemplateUrl('add-favorite-modal.html', {
   scope: $scope,
    animation: 'slide-in-up'
  }).then(function(modal) {
    $scope.modal = modal;
  });
  $scope.openAddFavoriteForm = function () {
    $scope.modal.show();
  };
  $scope.closeAddFavoriteForm = function() {
    $scope.modal.hide();
  };
  $scope.$on('$destroy', function() {
    $scope.modal.remove();
  });
});
<commit_msg>resolved jshint errors in controllers/favorites.js for #57<commit_after>'use strict';
angular.module('Trendicity')

.controller('FavoritesCtrl', function(
  $scope,
  $state,
  FavoritesService,
  $ionicModal,
  $ionicSideMenuDelegate
) {
  // Initialize variables needed for view
  $scope.favorite = {};
  $scope.favorites = FavoritesService.getFavorites();

  // Enable Menu Dragging
  $scope.$on('$ionicView.enter', function() {
    $ionicSideMenuDelegate.canDragContent(true);
  });

  // Add a new favorite using the service
  $scope.addFavorite = function(favorite) {
    FavoritesService.add(favorite).then(function () {
      $scope.favorites = FavoritesService.getFavorites();
      $scope.closeAddFavoriteForm();
    });
  };

  // Delete a favorite using the service and update scope var
  $scope.removeFavorite = function (favorite) {
    $scope.favorites = FavoritesService.delete(favorite);
  };

  // Favorite creation modal template and helper functions
  $ionicModal.fromTemplateUrl('add-favorite-modal.html', {
   scope: $scope,
    animation: 'slide-in-up'
  }).then(function(modal) {
    $scope.modal = modal;
  });
  $scope.openAddFavoriteForm = function () {
    $scope.modal.show();
  };
  $scope.closeAddFavoriteForm = function() {
    $scope.modal.hide();
  };
  $scope.$on('$destroy', function() {
    $scope.modal.remove();
  });
});

{'fraction_non_alphanumeric': 0.1495710555762775, 'fraction_numerical': 0.0007459903021260724, 'mean_word_length': 3.9392265193370166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4489707', 'n_tokens_mistral': 878, 'n_tokens_neox': 857, 'n_words': 159}