fix angular

This commit is contained in:
Matias Alejo Garcia 2014-04-16 19:14:58 -03:00
commit f8b4f8e4c9
8 changed files with 28 additions and 99 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copay.header').controller('HeaderController',
function($scope, $rootScope, $location, Network) {
function($scope, $rootScope, $location, walletFactory) {
$scope.menu = [{
'title': 'Home',
'icon': 'fi-home',
@ -35,15 +35,14 @@ angular.module('copay.header').controller('HeaderController',
return false;
};
$scope.init = function() {
$rootScope.isLogged = false;
};
$scope.signout = function() {
Network.disconnect(function() {
var w = $rootScope.wallet;
if (w) {
w.disconnect();
delete $rootScope['wallet'];
$location.path('signin');
$rootScope.$digest();
});
}
};
$scope.clearFlashMessage = function() {

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copay.peer').controller('PeerController',
function($scope, $rootScope, $location, $routeParams, Network) {
function($scope, $rootScope, $location, $routeParams) {
$scope.init = function() {
//Network.connect($rootScope.masterId);

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copay.send').controller('SendController',
function($scope, $rootScope, $location, Network) {
function($scope, $rootScope, $location) {
$scope.title = 'Send';
if (!$rootScope.wallet.id) {
@ -11,8 +11,6 @@ angular.module('copay.send').controller('SendController',
$scope.sendTest = function() {
var w = $rootScope.wallet;
var pkr = w.publicKeyRing;
var txp = w.txProposals;
w.createTx( '15q6HKjWHAksHcH91JW23BJEuzZgFwydBt', '12345',function() {
$rootScope.$digest();
});

View file

@ -46,20 +46,22 @@ console.log('[signin.js.42:create:]'); //TODO
$scope.join = function(cid) {
console.log('[signin.js.42:join:]'); //TODO
$scope.loading = true;
if (cid) {
Network.init(null, function() {
Network.connect(cid,
function() {
$location.path('peer');
$rootScope.$digest();
}, function() {
$rootScope.flashMessage = { message: 'Connection refussed', type: 'error'};
$location.path('home');
$rootScope.$digest();
});
});
}
//
// if (cid) {
// var w = walletFactory.(walletId);
//TODO
// Network.init(null, function() {
// Network.connect(cid,
// function() {
// $location.path('peer');
// $rootScope.$digest();
// }, function() {
// $rootScope.flashMessage = { message: 'Connection refussed', type: 'error'};
// $location.path('home');
// $rootScope.$digest();
// });
// });
// }
};
// if (peerData && peerData.peerId && peerData.connectedPeers.length > 0) {