ledgerrb/public/app/js/services/API.js
2014-10-20 12:52:49 +02:00

33 lines
811 B
JavaScript

app.service( 'API',
[ '$http',
function( $http ) {
this.balance = function( params ) {
return $http.get( '/api/ledger/balance', {
params: {
period: params.period,
categories: params.categories
}
} );
};
this.register = function( params ) {
return $http.get( '/api/ledger/register', {
params: {
period: params.period,
categories: params.categories
}
} );
};
this.dates_salaries = function( ) {
return $http.get( '/api/ledger/dates_salaries' );
};
this.accounts = function( ) {
return $http.get( '/api/ledger/accounts' );
};
this.cleared = function( ) {
return $http.get( '/api/ledger/cleared' );
};
} ] );