I tried two of the solutions here to no avail.
This is my Error:
angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module flavorApplication due to:
Error: [$injector:unpr] Unknown provider: underscore
Here is my code for the module:
var underscore = angular.module('underscore', []);
underscore.factory('_', ['$window', function() {
  return $window._;
}]);Here is my App Config:
(function(){
  angular.module("flavorApplication",
    ['ui.bootstrap',
        'ui.router',
        'angular-loading-bar',
        'angular-confirm',
        ]);
        angular.module("flavorApplication").config(['$stateProvider', '$urlRouterProvider', '$locationProvider', 
        'underscore', function ($stateProvider, $urlRouterProvider, $locationProvider, underscore){Here I'm trying to inject it into a Controller (probably where I'm going wrong)
(function () {
    'use strict';
    angular
        .module('flavorApplication')
        .controller('UsedSearchesController', UsedSearchesController);
    UsedSearchesController.$inject = ['$stateParams', '$state', 'DataService', '_'];
    function UsedSearchesController($stateParams, $state, DataService, _) {
        var vm = this;
        vm.currentSearches = $stateParams.search.split("|")
        activate(vm);
        ////////////////
        function activate(vm, _) {
            vm.removeSearch = function (searchTerm) {
              $stateParams.search =  _.filter(vm.currentSearches, 
              function(search){return search !== searchterm}).join("|")
                $state.go('home');
            }
        }
    }
})();
