Make directive to accept onScan and beforeScan callbacks instead of broadcasting 'dataScanned' event.

This will allow to reuse directive for screens different from 'send'
This commit is contained in:
Kosta Korenkov 2015-07-23 13:21:31 +03:00
commit 1f4f78bec0
3 changed files with 21 additions and 8 deletions

View file

@ -1,6 +1,14 @@
'use strict';
angular.module('copayApp.controllers').controller('topbarController', function($rootScope, $scope, $timeout, $modal, isCordova, isMobile, go) {
angular.module('copayApp.controllers').controller('topbarController', function($rootScope, go) {
this.onQrCodeScanned = function(data) {
$rootScope.$emit('dataScanned', data);
};
this.openSendScreen = function() {
go.send();
};
this.goHome = function() {
go.walletHome();