title: ionic Unknown provider Service.js Ionic
body: <p>I just learning about ionic. I want to make a service to my controller.
  But when i make and run, there's error like this :</p>
  
  <pre><code>ionic.bundle.js:26794 Error: [$injector:unpr] Unknown provider: scoreServiceProvider &lt;- scoreService &lt;- datarateCtrl
  </code></pre>
  
  <p>Here my service.js code :</p>
  
  <pre><code>angular.module('starter.services', [])
  
  .factory('FirstService', function($http) {
  var baseUrl = 'http://192.168.0.101/xxx/grabdata/';
  return {
      getAll: function() {
          return $http.get(baseUrl+'select.php');
      },
      getId: function (beritaId){
          return $http.get(baseUrl+'select_id.php?id='+beritaId); 
      }
  
  };
  
  });
  
  var StudentService = angular.module('ionicApp', [ionic])
  StudentService.factory('scoreService', function($http) {
  var baseUrl = 'http://192.168.0.101/xxx/grabdata/';
  return {
      getAll: function() {
          return $http.get(baseUrl+'selectxxxx.php');
      }
  
  };
  
  });
  </code></pre>
  
  <p>Here my controller.js code :</p>
  
  <pre><code>.controller('datarateCtrl', function($scope,$state, scoreService,$timeout, $ionicLoading){
  $scope.showData = function() {
    scoreService.getAll().success(function(data) {
          $scope.datarate = data;
      }).finally(function() {
          $scope.$broadcast('scroll.refreshComplete');
      });
  };
  
  
  $scope.reload = function (){
      $state.go('tab.klasemen');
  };
  
  // Setup the loader
    $scope.loading = $ionicLoading.show({
  content: '&lt;i class="icon ion-load-a"&gt;&lt;/i&gt;',
  animation: 'fade-in',
  showBackdrop: true,
  maxWidth: 50,
  showDelay: 0
    });
  
    $timeout(function () {
  $scope.showData();
  $ionicLoading.hide();
   }, 2000);
  
  })
  </code></pre>
  
  <p>Here my html code (klasemen.html)</p>
  
  <pre><code>&lt;html ng-app="ionicApp"&gt;
   &lt;ion-header-bar class="bar bar-header bar-positive" align-title="center"&gt;
      &lt;h1 class="title"&gt;xxxx&lt;/h1&gt;
   &lt;/ion-header-bar&gt;
  
  &lt;ion-view&gt;
  &lt;ion-content padding="false" class="has-header"&gt;
      &lt;ion-refresher
          pulling-text="Pull to refresh..."
          on-refresh="showData()"&gt;
        &lt;/ion-refresher&gt;
  
              &lt;div class="row header"&gt;
                    &lt;div class="col"&gt;xx&lt;/div&gt;
                    &lt;div class="col"&gt;xx&lt;/div&gt;
                    &lt;div class="col"&gt;xx&lt;/div&gt;
                    &lt;div class="col"&gt;xx&lt;/div&gt;
                    &lt;div class="col"&gt;xx&lt;/div&gt;
                    &lt;div class="col"&gt;xx&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="row" ng-repeat="data in datarate"&gt;
                    &lt;div class="col"&gt;{{data.xx}}&lt;/div&gt;
                    &lt;div class="col"&gt;{{data.xx}}&lt;/div&gt;
                    &lt;div class="col"&gt;{{data.xx}}&lt;/div&gt;
                    &lt;div class="col"&gt;{{data.xx}}&lt;/div&gt;
                    &lt;div class="col"&gt;{{data.xx}}&lt;/div&gt;
                    &lt;div class="col"&gt;{{data.xx}}&lt;/div&gt;
              &lt;/div&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>Here my app.js</p>
  
  <pre><code>.state('tab.klasemen', {
    url: '/klasemen',
    views: {
      'tab-klasemen': {
        templateUrl: 'templates/klasemen.html',
        controller: 'datarateCtrl'
      }
    }
  })
  </code></pre>
  
  <p>can anyone tell what i miss or what is error with my code?
  Thank you so much guys.</p>