title: Get JSON data with AngularJS and add methods on the returning object
body: <p>I need to get some JSON data from the server with Angular. Let's say the user data. I created a service like that:
  </p>
  
  <pre><code>app.service('User', function($http) {
    retrun $http({method: 'GET', url:'/current_user'});
  });
  </code></pre>
  
  <p>And in my controller:
  </p>
  
  <pre><code>app.controller('SomeCtrl', function($scope, User) {
    User.success(function(data) {
      $scope.user = data;
    });
  });
  </code></pre>
  
  <p>That works just fine but what if I want to add some methods to the user? For instance in the view I would like to do <code>{{user.isAdmin()}}</code>. Is it the correct approach? Where can I add those methods?</p>