Wallet/src/js/controllers/amazon.js

24 lines
709 B
JavaScript
Raw Normal View History

'use strict';
2016-07-21 11:18:48 -03:00
angular.module('copayApp.controllers').controller('amazonController',
function($scope, $timeout, $ionicModal, $log, $state, $ionicHistory, lodash, amazonService, externalLinkService, popupService) {
2016-09-23 13:05:50 -03:00
2016-12-12 17:29:11 -03:00
$scope.openExternalLink = function(url) {
externalLinkService.open(url);
};
var initAmazon = function() {
2016-07-21 11:18:48 -03:00
amazonService.getPendingGiftCards(function(err, gcds) {
if (err) $log.error(err);
$scope.giftCards = gcds;
$timeout(function() {
$scope.$digest();
});
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.network = amazonService.getNetwork();
initAmazon();
});
});