change event to rootscope

This commit is contained in:
Matias Alejo Garcia 2015-04-28 18:11:06 -03:00
commit 32ae89046d
2 changed files with 5 additions and 5 deletions

View file

@ -25,13 +25,13 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.isMobile = isMobile.any(); this.isMobile = isMobile.any();
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) { var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
$scope.$emit('Local/SetTab', 'send');
self.setForm(data); self.setForm(data);
$rootScope.$emit('Local/SetTab', 'send');
}); });
var disablePaymentUriListener = $rootScope.$on('paymentUri', function(event, uri) { var disablePaymentUriListener = $rootScope.$on('paymentUri', function(event, uri) {
$timeout(function() { $timeout(function() {
$scope.$emit('Local/SetTab', 'send'); $rootScope.$emit('Local/SetTab', 'send');
self.setForm(uri); self.setForm(uri);
}, 100); }, 100);
}); });

View file

@ -443,16 +443,16 @@ angular
url: '/cordova/:status', url: '/cordova/:status',
views: { views: {
'main': { 'main': {
controller: function($scope, $stateParams, go) { controller: function($rootScope, $stateParams, go) {
switch ($stateParams.status) { switch ($stateParams.status) {
case 'resume': case 'resume':
$scope.$emit('Local/Resume'); $rootScope.$emit('Local/Resume');
break; break;
// case 'online': // case 'online':
// // $scope.$emit('Local/Online'); // // $scope.$emit('Local/Online');
// break; // break;
case 'offline': case 'offline':
$scope.$emit('Local/Offline'); $rootScope.$emit('Local/Offline');
break; break;
}; };
go.walletHome(); go.walletHome();