title: Angular Js : '$q.defer is not a function' error
body: <p>After Refering this <a href="https://stackoverflow.com/questions/21444100/angularjs-how-to-http-get-data-and-store-it-in-service">Link</a> , I am trying to get JSON data into my angular service. <br><br></p>
  
  <p><strong>Service:</strong><br></p>
  
  <pre><code>.factory('restservice', ['$rootScope','$http', '$q', '$log',
  function($rootScope,$q, $http) {
  return {
      getData: function() {
          var defer = $q.defer();
          $http.get('xyz.com/abc.php', { cache: 'true'})
          .success(function(data) {
              defer.resolve(data);
          });
  
          return defer.promise;
        }
  };
  }])
  </code></pre>
  
  <p><br>
  <strong>Controller:</strong><br></p>
  
  <pre><code>.controller('RestaurantsCtrl', function ($scope,$http, restservice,restViewservice){
  
        restservice.getData().then(function(data) {
        $scope.Restaurants = data;
      });
  
  })
  </code></pre>
  
  <p><br>After Implementing this console says <strong>'$q.defer is not a function'</strong>.</p>
  
  <p>What's the issue here? Please Help ...!! Am new to Angular Js so forgive if something is wrong.</p>