code maintenance
This commit is contained in:
@@ -44,14 +44,6 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
|||||||
|
|
||||||
$scope.postTransaction = function() {
|
$scope.postTransaction = function() {
|
||||||
|
|
||||||
console.log('postTransaction()');
|
|
||||||
|
|
||||||
// simple HTTP POST
|
|
||||||
// $http.post('/transactions', { "amount" : $scope.amount /* date, */ }).success(function() {
|
|
||||||
// console.log('REFRESH');
|
|
||||||
// $scope.initList();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// via Resource (might be moved into a service)
|
// via Resource (might be moved into a service)
|
||||||
var Transaction = $resource('/transactions');
|
var Transaction = $resource('/transactions');
|
||||||
|
|
||||||
@@ -64,18 +56,9 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
|||||||
"creditor" : $scope.creditor
|
"creditor" : $scope.creditor
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(newTransaction);
|
newTransaction.$save(function(transaction) {
|
||||||
|
|
||||||
// create copy of transaction object
|
|
||||||
var newTransactionCopy = (JSON.parse(JSON.stringify(newTransaction)));
|
|
||||||
|
|
||||||
$scope.newTransaction = newTransaction;
|
|
||||||
$scope.newTransactionCopy = newTransactionCopy;
|
|
||||||
|
|
||||||
newTransaction.$save(function(transaction, putResponseHeaders) {
|
|
||||||
$scope.refreshList();
|
$scope.refreshList();
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.showTransaction = function(transaction) {
|
$scope.showTransaction = function(transaction) {
|
||||||
|
|||||||
@@ -37,15 +37,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<pre style="font-size: 75%; color: darkred;">{{newTransaction | json}}</pre>
|
<pre style="font-size: 75%; color: darkgray;">{{transactions | json}}</pre>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<pre style="font-size: 75%; color: darkgreen;">{{newTransactionCopy | json}}</pre>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<pre style="font-size: 75%">{{account | json}}</pre>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user