title: Angular js service returns function objects when called from a controller?
body: <pre><code>var newservices = angular.module('newservices', []);
  newservices.service('newservice', function ($http) {
  return{
  newdata: function(parameter){
              return $http.get('/devicedetails/'+parameter).success(function(data)        {
                  console.log(data)
                  return data
  
              });
  
  },
  }
  });
  </code></pre>
  
  <p>The above service is included in one of my controllers</p>
  
  <pre><code>data=newService.newdata($scope.dummy)
  console.log(data)
  </code></pre>
  
  <p>while trying to print data what i  get is $http function object as shown below</p>
  
  <pre><code>Object {then: function, catch: function, finally: function, success: function, error: function} 
  </code></pre>
  
  <p>why is this so??</p>