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();
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
$scope.$emit('Local/SetTab', 'send');
self.setForm(data);
$rootScope.$emit('Local/SetTab', 'send');
});
var disablePaymentUriListener = $rootScope.$on('paymentUri', function(event, uri) {
$timeout(function() {
$scope.$emit('Local/SetTab', 'send');
$rootScope.$emit('Local/SetTab', 'send');
self.setForm(uri);
}, 100);
});

View file

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