moved Transaction into service
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
var transactionServices = angular.module('transactionServices', [ 'ngResource' ]);
|
||||
|
||||
transactionServices.factory('Transaction', [ '$resource', function($resource) {
|
||||
return $resource('/transactions/:id', {}, {
|
||||
/*query : {
|
||||
method : 'GET',
|
||||
params : {
|
||||
phoneId : 'phones'
|
||||
},
|
||||
isArray : true
|
||||
}*/
|
||||
});
|
||||
} ]);
|
||||
|
||||
/*
|
||||
// via Resource (might be moved into a service)
|
||||
var Transaction = $resource('/transactions');
|
||||
|
||||
var newTransaction = new Transaction({
|
||||
"account" : $scope.account._links.self.href,
|
||||
"amount" : amount,
|
||||
"date" : $scope.transaction.date,
|
||||
"description" : $scope.transaction.description,
|
||||
"category" : $scope.transaction.category._links.self.href,
|
||||
"creditor" : $scope.transaction.creditor
|
||||
});
|
||||
|
||||
newTransaction.$save(function(transaction) {
|
||||
$scope.refreshList();
|
||||
$scope.lastSubmission = newTransaction;
|
||||
});
|
||||
*/
|
||||
Reference in New Issue
Block a user