title: Get error : [$injector:unpr] Unknown provider: socketProvider <- socket <- LogCtrl
body: <p>I am new to AngularJs and nodejs and I have a simple chat app with angular as client and socketio as server side. I got an error when loading angular page </p>
  
  <pre><code>Error: [$injector:unpr] Unknown provider: socketProvider &lt;- socket &lt;- LogCtrl
  </code></pre>
  
  <p>My client side</p>
  
  <pre><code>    &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://localhost:1337/socket.io/socket.io.js"&gt;&lt;/script&gt;
  
  &lt;script type="application/javascript"&gt;
       socket = io.connect('http://localhost:1337/');
       angular.module('Log',['ngRoute'])
  
               .controller('LogCtrl',['$scope','socket','$location', function($scope,socket,$location){
  
                   console.log('ok baby !!');
  
                   $scope.addUser = function(){
                       socket.emit('init',$scope.user);
                       $location.path("/view/index.html");
                   };
  
               }]);
   &lt;/script&gt;
  
  &lt;body  ng-app = "Log" &gt;
  &lt;div class=" main"  ng-controller = "LogCtrl" style = "width: 300px; "&gt;
  &lt;fieldset&gt;
       &lt;form  ng-submit = "addUser()"&gt;
           &lt;h2 &gt;Hello!!&lt;/h2&gt;
           &lt;input ng-model = "user" required  style = "width: 200px; " placeholder = "Nhập tên của bạn" &gt;
           &lt;input type = "submit" value = "OK"&gt;
      &lt;/form&gt;
  &lt;/fieldset&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please help me what wrong with my client</p>
  
  <hr>
  
  <p>I try to redirect to index.html by adding some codes</p>
  
  <pre><code>.config(['$routeProvider','$locationProvider', function($routeProvider,$locationProvider){
                   $routeProvider.
                               when('/main', {
                                   templateUrl: 'view/index.html',
                                   controller: 'ChatCtrl'
                               })
                   $locationProvider.html5Mode({
                       enabled: true,
                       requireBase: false
                   });
                   }])
  
               .controller('LogCtrl',['$scope','$location', function($scope,$location){
  
                           console.log('ok baby !!');
  
                           $scope.addUser = function(){
                               socket.emit('init',$scope.user);
                               $location.path("/main");
                           };
                       }]);
  </code></pre>
  
  <p>but it not working, alway reload that side (log.html)</p>