Change $http to the $resource