Wallet/js/controllers/homeWallet.js

16 lines
550 B
JavaScript
Raw Normal View History

2014-10-31 11:49:52 -03:00
'use strict';
2014-12-02 14:33:46 -03:00
angular.module('copayApp.controllers').controller('HomeWalletController', function($scope, $rootScope) {
$scope.init = function() {
2014-12-02 17:32:32 -03:00
2014-10-31 11:49:52 -03:00
$rootScope.title = 'Home';
2014-11-29 18:35:48 -03:00
$scope.addr = _.last($rootScope.wallet.getReceiveAddresses());
2014-10-31 11:49:52 -03:00
2014-11-29 18:35:48 -03:00
// This is necesarry, since wallet can change in homeWallet, without running init() again.
$rootScope.$watch('wallet', function() {
2014-12-02 17:32:32 -03:00
if ($rootScope.wallet && $rootScope.wallet.isComplete()) {
$scope.addr = _.last($rootScope.wallet.getReceiveAddresses());
}
2014-11-29 18:35:48 -03:00
});
2014-12-02 14:33:46 -03:00
};
});