added tests for angular services
This commit is contained in:
parent
02af76cdb9
commit
09532f0aaa
3 changed files with 28 additions and 4 deletions
|
|
@ -3,7 +3,7 @@
|
|||
angular.module('copay.controllerUtils').factory('controllerUtils', function ($rootScope, $location, Socket) {
|
||||
var root = {};
|
||||
|
||||
root.logout = function(scope) {
|
||||
root.logout = function() {
|
||||
delete $rootScope['wallet'];
|
||||
$rootScope.totalBalance = 0;
|
||||
$location.path('signin');
|
||||
|
|
@ -15,7 +15,6 @@ angular.module('copay.controllerUtils').factory('controllerUtils', function ($ro
|
|||
root.logout();
|
||||
}
|
||||
|
||||
|
||||
root.onErrorDigest = function(scope) {
|
||||
root.onError(scope);
|
||||
$rootScope.$digest();
|
||||
|
|
@ -31,10 +30,12 @@ angular.module('copay.controllerUtils').factory('controllerUtils', function ($ro
|
|||
$rootScope.wallet = w;
|
||||
root.updateBalance();
|
||||
});
|
||||
|
||||
w.on('refresh', function() {
|
||||
console.log('[controllerUtils.js] Refreshing'); //TODO
|
||||
root.updateBalance();
|
||||
});
|
||||
|
||||
w.on('openError', root.onErrorDigest);
|
||||
w.on('close', root.onErrorDigest);
|
||||
w.netStart();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue