Cleaning controllers. Also call connect socket-ii in all pages. Everything work!

This commit is contained in:
Gustavo Cortez 2014-04-17 13:25:36 -03:00
commit 8ab479691d
6 changed files with 68 additions and 46 deletions

View file

@ -1,29 +1,33 @@
'use strict';
angular.module('copay.transactions').controller('TransactionsController',
function($scope, $rootScope, $location) {
function($scope, $rootScope, $location, Socket, controllerUtils) {
$scope.title = 'Transactions';
$scope.oneAtATime = true;
if (!$rootScope.wallet.id) {
if (!$rootScope.wallet || !$rootScope.wallet.id) {
$location.path('signin');
}
else {
$scope.txsinput = [
{
fromAddr: "n3zUqNR7Bbbc4zJhPVj1vG2Lx66K3Xhzvb",
toAddr: "msvv2mDfE298s7boXwALq4Dqv77K3TWRZ1",
amount: 23.9982
},
{
fromAddr: "my9wnLwwUrwpNfEgSrWY62ymEGf1edKf4J",
toAddr: "monCusNiDuptf68rtr58hEjKpJt6cW6zwS",
amount: 2.22
}
];
$scope.txsinput = [
{
fromAddr: "n3zUqNR7Bbbc4zJhPVj1vG2Lx66K3Xhzvb",
toAddr: "msvv2mDfE298s7boXwALq4Dqv77K3TWRZ1",
amount: 23.9982
},
{
fromAddr: "my9wnLwwUrwpNfEgSrWY62ymEGf1edKf4J",
toAddr: "monCusNiDuptf68rtr58hEjKpJt6cW6zwS",
amount: 2.22
$scope.txsoutput = $rootScope.wallet.getTxProposals();
var socket = Socket($scope);
socket.on('connect', controllerUtils.handleTransactionByAddress($scope));
}
];
$scope.txsoutput = $rootScope.wallet.getTxProposals();
$scope.sign = function (ntxid) {
var w = $rootScope.wallet;