working with events

This commit is contained in:
Matias Alejo Garcia 2014-11-30 00:44:25 -03:00
commit 494c21132a
4 changed files with 26 additions and 10 deletions

View file

@ -24,6 +24,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
}
$rootScope.starting = true;
identityService.open(form.email.$modelValue, form.password.$modelValue, function(err) {
console.log('[home.js.27]'); //TODO
$rootScope.starting = false;
if (err) {
copay.logger.warn(err);

View file

@ -44,14 +44,30 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
$scope.init = function() {
// Change focused wallet
if ($rootScope.wallet) {
$rootScope.$watch('wallet', function() {
$scope.walletSelection = false;
$scope.setWallets();
});
}
};
// Change wallet list
if ($rootScope.iden) {
var iden = $rootScope.iden;
iden.on('newWallet', function() {
$scope.walletSelection = false;
$scope.setWallets();
});
iden.on('deleteWallet', function() {
$scope.walletSelection = false;
$scope.setWallets();
});
}
};
$scope.setWallets = function() {
if (!$rootScope.iden) return;