Wallet/src/js/controllers/proposals.js

32 lines
891 B
JavaScript
Raw Normal View History

2016-09-01 19:14:18 -03:00
'use strict';
angular.module('copayApp.controllers').controller('proposalsController',
function($timeout, $scope, profileService, $log, txpModalService, addressbookService, timeService) {
2016-09-01 19:14:18 -03:00
$scope.fetchingProposals = true;
2016-09-01 19:14:18 -03:00
2016-12-14 13:24:02 -03:00
$scope.$on("$ionicView.enter", function(event, data) {
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
$scope.addressbook = ab || {};
profileService.getTxps(50, function(err, txps) {
$scope.fetchingProposals = false;
if (err) {
$log.error(err);
return;
}
$scope.txps = txps;
$timeout(function() {
$scope.$apply();
});
});
2016-09-01 19:14:18 -03:00
});
});
2016-09-01 19:14:18 -03:00
$scope.openTxpModal = txpModalService.open;
2016-12-14 15:18:52 -03:00
$scope.createdWithinPastDay = function(time) {
return timeService.withinPastDay(time);
2016-12-14 15:18:52 -03:00
};
2016-09-01 19:14:18 -03:00
});