title: unknown provider factoryprovider <- factory <- controller angular js
body: <p>I am having problem while injecting dependency from service to controller. Although i added it but still same error of </p>
  
  <blockquote>
    <p>Unknown provider: websiteFactoryProvider &lt;- websiteFactory &lt;- listCtrl</p>
  </blockquote>
  
  <p>I basically need to render a ng-view to my index.html</p>
  
  <p><strong>Index.html</strong></p>
  
  <pre><code>&lt;div ng-view&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var app = angular.module('app', ['ngRoute']);
  
  app.config(['$routeProvider', function ($routeProvider) {
      $routeProvider.
  
      when('/list', {
          templateUrl: 'app/views/list.html', controller: 'listCtrl'
      }).
  
      otherwise({
          redirectTo: '/list'
      });
  
  }]);
  </code></pre>
  
  <p><strong>websiteService.js</strong></p>
  
  <pre><code>app.factory('webiteFactory', ['$http', '$location', function ($http, $location) {
  
      var factory = {};
  
      // method that return all websites from an http request
      factory.getAllWebsites = function () {
          return $http.get("http://localhost/Replicate/GetAllWebsites");
      }
  
      //method that returns an object from given array
      factory.getFilteredObject = function (list, websiteName) {
          for (i = 0 ; i &lt; list.length ; i++) {
              if (list[i].Name == websiteName)
                  return list[i];
          }
      }
  
  
      return factory;
  }]);
  
  
  /* application services that would not return values */
  app.service('websiteService', ['$http', function ($http) {
  
      //service for pagination
      this.paginate = function ($scope) {
  
          //pagination code
          $scope.currentPage = 1;
          $scope.totalItems = $scope.model.length;
          $scope.numPerPage = 10;
          $scope.paginate = function (value) {
              var begin, end, index;
              begin = ($scope.currentPage - 1) * $scope.numPerPage;
              end = begin + $scope.numPerPage;
              index = $scope.model.indexOf(value);
              return (begin &lt;= index &amp;&amp; index &lt; end);
          };
  
  
          //ordering code
          $scope.reverse = true;
          $scope.order = function (predicate) {
              $scope.reverse = ($scope.predicate === predicate) ? !$scope.reverse : false;
              $scope.predicate = predicate;
          };
      }
  
      //service to change state of a website
      this.changeSiteState = function (website) {
          var newState = website.State == "Stopped" ? "Started" : "Stopped";
          $http({
              method: 'POST',
              url: '/Replicate/ChangeState/',
              data: JSON.stringify({ webName: website.Name, state: newState }),
              headers: { 'Content-Type': 'application/json' }
          }).success(function (data) {
              if (data == "success") {
                  website.State = website.State == "Stopped" ? "Started" : "Stopped";
              }
              else {
                  alert(data);
              }
  
          }).error(function (data, status, headers, config) {
              alert(data);
          });
      }
  }])
  </code></pre>
  
  <p><strong>listCtrl.js</strong></p>
  
  <pre><code>app.controller('listCtrl', function websiteCtrl($scope, $location, websiteFactory, websiteService, $modal) {
  
      //function triggered at the intialization of controller
      $scope.init = function () {
          $scope.model = [];
          setTimeout(function () {
              websiteFactory.getAllWebsites().success(function (data) {
                  $scope.model = data;
                  websiteService.paginate($scope);
              })
          }, 0);
      };
  
      //delegation of change state to service method
      $scope.changeState = function (website) {
          websiteService.changeSiteState(website);
      }
  
      //open modal and shows details of single object
      $scope.showDetails = function (websiteName) {
          var modalInstance = $modal.open({
              templateUrl: '../Views/Replicate/Details.html',
              controller: 'DetailsCtrl',
              resolve: {
                  obj: function () {
                      return websiteFactory.getFilteredObject($scope.model, websiteName);
                  }
              }
          });
      }
  
  });
  </code></pre>