title: What does Error: [$injector:unpr] Unknown provider: tProvider <- t <- myActiveLinkDirective mean?
body: <p>Basically I am testing to see how a PROD version of my app is looking; I proceeded to run it through some gulp tasks (minify, strip unused css etc.) and got this error:</p>
  
  <pre><code> Error: [$injector:unpr] Unknown provider: tProvider &lt;- t &lt;- myActiveLinkDirective
  </code></pre>
  
  <p>Can anyone help with what's going on here?</p>
  
  <p>This is some my angular code:</p>
  
  <pre><code>  var rustyApp = angular.module('rustyApp', [
      'ngAnimate',
      'ngRoute',
      'viewController',
      'mm.foundation',
      'angular-flexslider',
      'ui.router']).config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
            $routeProvider.when('/', {
          title: 'home',
          templateUrl: '/partials/home.html',
          controller: 'HomeController'
      }).when('/work', {
          title: 'my work',
          templateUrl: '/partials/work.html',
          controller: 'WorkController'
      }).when('/contact', {
          title: 'contact',
          templateUrl: '/partials/contact.html',
          controller: 'ContactController'
      }).otherwise({redirectTo: '/'});
      // configure html5 to get links working
  
      $locationProvider.html5Mode(true);
  
      }]);
  
  
  
  
       rustyApp.controller('BasicSliderCtrl', function($scope) {
          $scope.slides = [
             '../images/sliderContent/1.jpg',
             '../images/sliderContent/2.jpg',
             '../images/sliderContent/3.jpg',
             '../images/sliderContent/4.jpg'
          ];
  
       });
  
       rustyApp.run(function() {
          FastClick.attach(document.body);
       });
  
      rustyApp.run(['$location', '$rootScope', function($location, $rootScope) {
          $rootScope.$on('$routeChangeSuccess', function(event, current, previous) {
              $rootScope.title = current.$$route.title;
          });
      }]);
  
  
      rustyApp.controller('HomeController', function($scope) {
          $scope.pageClass = 'home';
      });
      rustyApp.controller('WorkController', function($scope) {
          $scope.pageClass = 'work';
      });
      rustyApp.controller('ContactController', function($scope) {
          $scope.pageClass = 'contact';
      });
  
      rustyApp.controller('OffCanvasDemoCtrl', function($scope) {});
  
  
      var OffCanvasDemoCtrl = function($scope) {};
  
      rustyApp.controller('ContactController', function($scope, $http) {
      $scope.result = 'hidden'
      $scope.resultMessage;
      $scope.formData; //formData is an object holding the name, email, subject, and message
      $scope.submitButtonDisabled = false;
      $scope.submitted = false; //used so that form errors are shown only after the form has been submitted
      $scope.submit = function(contactform) {
          $scope.submitted = true;
          $scope.submitButtonDisabled = true;
          if (contactform.$valid) {
              $http({
                  method: 'POST',
                  url: '../partials/mailer.php',
                  data: $.param($scope.formData), //param method from jQuery
                  headers: {
                      'Content-Type': 'application/x-www-form-urlencoded'
                  } //set the headers so angular passing info as form data (not request payload)
              }).success(function(data) {
                  console.log(data);
                  if (data.success) { //success comes from the return json object
                      $scope.submitButtonDisabled = true;
                      $scope.resultMessage = data.message;
                      $scope.result = 'bg-success';
                      if ($scope.result === 'bg-success') {
                          $scope.class = "bg-success";
                      }
                      // if($scope.result){setTimeout(window.location.reload(true),4000);}
                      if ($scope.result) {
                          setTimeout(function() {
                              window.location.reload(true)
                          }, 4000);
                      }
                  } else {
                      $scope.submitButtonDisabled = false;
                      $scope.resultMessage = data.message;
                      $scope.result = 'bg-danger';
                  }
              });
          } else {
              $scope.submitButtonDisabled = false;
              if ($scope.submitButtonDisabled) {
                  $scope.class = "bg-danger";
              }
              $scope.resultMessage = 'Failed Please fill out all the fields.';
              $scope.result = 'bg-danger';
          }
      }
  });
  
  var viewController = angular.module('viewController', []);
  
  rustyApp.directive('myActiveLink', function($location) {
      return {
          restrict: 'A',
          scope: {
              path: "@myActiveLink"
          },
          link: function(scope, element, attributes) {
              scope.$on('$locationChangeSuccess', function() {
                  if ($location.path() === scope.path) {
                      element.addClass('uk-active');
                  } else {
                      element.removeClass('uk-active');
                  }
              });
          }
      };
  });
  // var $j = jQuery.noConflict();
  
  // $j(function() {
  //     $j('#Container').mixItUp();
  
  // });
  
      rustyApp.directive('mixItUp', function() {
          var directive = {
              restrict: 'A',
              link: link
          };
  
          return directive;
  
          function link(scope, element, attrs) {
              var $j = jQuery.noConflict();
              var mixContainer = $j('#Container');
              mixContainer.mixItUp();
              mixContainer.on('$destroy', function() {
                  mixContainer.mixItUp('destroy');
              });
  
          }
      });
  
  
      rustyApp.directive('share', function() {
          var directive = {
              restrict: 'A',
              link: link
          };
  
          return directive;
  
          function link(scope, element, attrs) {
              var $s = jQuery.noConflict();
              // mixContainer.on('$destroy', function() {
              //     mixContainer.mixItUp('destroy');
              // });
          var $s = new Share(".share-button", {
            networks: {
              facebook: {
                app_id: "602752456409826",
              }
            }
          });
  
          }
      });
  
      rustyApp.directive('animationOverlay', function() {
          var directive = {
              restrict: 'A',
              link: link
          };
  
          return directive;
  
          function link(scope, element, attrs) {
              var modal = $.UIkit.modal(".modalSelector");
  
              if (modal.isActive()) {
                  modal.hide();
              } else {
                  modal.show();
              }
  
          }
      });
  </code></pre>
  
  <p><strong>UPDATED CODE</strong></p>
  
  <pre><code>    var rustyApp = angular.module('rustyApp', [
      'ngAnimate',
      'ngRoute',
      'viewController',
      'mm.foundation',
      'angular-flexslider',
      'ui.router'
  ]).config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
      $routeProvider.when('/', {
          title: 'home',
          templateUrl: '/partials/home.html',
          controller: 'HomeController'
      }).when('/work', {
          title: 'my work',
          templateUrl: '/partials/work.html',
          controller: 'WorkController'
      }).when('/contact', {
          title: 'contact',
          templateUrl: '/partials/contact.html',
          controller: 'ContactController'
      }).otherwise({redirectTo: '/'});
      // configure html5 to get links working
  
      $locationProvider.html5Mode(true);
  
  }]);
  
  
   rustyApp.controller('BasicSliderCtrl', ['$scope', 
      function($scope) {
      $scope.slides = [
          '../images/sliderContent/1.jpg',
          '../images/sliderContent/2.jpg',
          '../images/sliderContent/3.jpg',
          '../images/sliderContent/4.jpg'
      ];
  
  }]);
  
  
  rustyApp.run(function() {
      FastClick.attach(document.body);
    });
  
  rustyApp.run(['$location', '$rootScope', function($location, $rootScope) {
      $rootScope.$on('$routeChangeSuccess', function(event, current, previous) {
          $rootScope.title = current.$$route.title;
      });
  }]);
  
  
  rustyApp.controller('HomeController', ['$scope', function($scope) {
       $scope.pageClass = 'home';
  }]);
  rustyApp.controller('WorkController', ['$scope', function($scope) {
       $scope.pageClass = 'work';
  }]);
  rustyApp.controller('ContactController', ['$scope', function($scope) {
       $scope.pageClass = 'contact';
  }]);
  rustyApp.controller('OffCanvasDemoCtrl', ['$scope', function($scope) {}]);
  
  
  var OffCanvasDemoCtrl = function($scope) {};
  
  rustyApp.controller('ContactController', ['$scope', function($scope, $http) {
      $scope.result = 'hidden'
      $scope.resultMessage;
      $scope.formData; //formData is an object holding the name, email, subject, and message
      $scope.submitButtonDisabled = false;
      $scope.submitted = false; //used so that form errors are shown only after the form has been submitted
      $scope.submit = function(contactform) {
          $scope.submitted = true;
          $scope.submitButtonDisabled = true;
          if (contactform.$valid) {
              $http({
                  method: 'POST',
                  url: '../partials/mailer.php',
                  data: $.param($scope.formData), //param method from jQuery
                  headers: {
                      'Content-Type': 'application/x-www-form-urlencoded'
                  } //set the headers so angular passing info as form data (not request payload)
              }).success(function(data) {
                  console.log(data);
                  if (data.success) { //success comes from the return json object
                      $scope.submitButtonDisabled = true;
                      $scope.resultMessage = data.message;
                      $scope.result = 'bg-success';
                      if ($scope.result === 'bg-success') {
                          $scope.class = "bg-success";
                      }
                      // if($scope.result){setTimeout(window.location.reload(true),4000);}
                      if ($scope.result) {
                          setTimeout(function() {
                              window.location.reload(true)
                          }, 4000);
                      }
                  } else {
                      $scope.submitButtonDisabled = false;
                      $scope.resultMessage = data.message;
                      $scope.result = 'bg-danger';
                  }
              });
          } else {
              $scope.submitButtonDisabled = false;
              if ($scope.submitButtonDisabled) {
                  $scope.class = "bg-danger";
              }
              $scope.resultMessage = 'Failed Please fill out all the fields.';
              $scope.result = 'bg-danger';
          }
      }
  }]);
  
  var viewController = angular.module('viewController', []);
  
  rustyApp.directive('myActiveLink', ['$location', function($location) {
      return {
          restrict: 'A',
          scope: {
              path: "@myActiveLink"
          },
          link: function(scope, element, attributes) {
              scope.$on('$locationChangeSuccess', function() {
                  if ($location.path() === scope.path) {
                      element.addClass('uk-active');
                  } else {
                      element.removeClass('uk-active');
                  }
              });
          }
      };
  }]);
  // var $j = jQuery.noConflict();
  
  // $j(function() {
  //     $j('#Container').mixItUp();
  
  // });
  
  rustyApp.directive('mixItUp', function() {
      var directive = {
          restrict: 'A',
          link: link
      };
  
      return directive;
  
      function link(scope, element, attrs) {
          var $j = jQuery.noConflict();
          var mixContainer = $j('#Container');
          mixContainer.mixItUp();
          mixContainer.on('$destroy', function() {
              mixContainer.mixItUp('destroy');
          });
  
      }
  });
  
  
  rustyApp.directive('share', function() {
      var directive = {
          restrict: 'A',
          link: link
      };
  
      return directive;
  
      function link(scope, element, attrs) {
          var $s = jQuery.noConflict();
          // mixContainer.on('$destroy', function() {
          //     mixContainer.mixItUp('destroy');
          // });
      var $s = new Share(".share-button", {
        networks: {
          facebook: {
            app_id: "602752456409826",
          }
        }
      });
  
      }
  });
  
  rustyApp.directive('animationOverlay', function() {
      var directive = {
          restrict: 'A',
          link: link
      };
  
      return directive;
  
      function link(scope, element, attrs) {
          var modal = $.UIkit.modal(".modalSelector");
  
          if (modal.isActive()) {
              modal.hide();
          } else {
              modal.show();
          }
  
      }
  });
  </code></pre>
  
  <p><strong>UPDATE</strong> </p>
  
  <p>So I wound using <a href="https://www.npmjs.org/package/gulp-ng-annotate/">gulp-ng-annotate</a>and it appears to add the syntax which was suggested below :) However when I try a PROD build I don't get any errors or anything, it just fails silently. Can anyone help?</p>