account.factory.js 418 B

123456789101112131415
  1. (function(){
  2. 'use strict';
  3. app.factory('account.repository', function(webApi, $http){
  4. return {
  5. getBooks: _getBooks,
  6. getBookById: _getBookById
  7. }
  8. function _getBooks(){
  9. return $http.get(webApi.DOMAIN + '/api/v2/books')
  10. }
  11. function _getBookById(id){
  12. return $http.get(webApi.DOMAIN + '/api/v2/books/' + id)
  13. }
  14. })
  15. })()