Wallet/js/controllers/signin.js

24 lines
561 B
JavaScript
Raw Normal View History

'use strict';
angular.module('cosign.signin').controller('SigninController',
function($scope, $rootScope, $location, Network) {
$rootScope.peerId = null;
$scope.peerReady = false;
// Init peer
Network.init(function(pid) {
$rootScope.peerId = pid;
$rootScope.$digest();
$scope.peerReady = true;
$scope.$digest();
});
$scope.join = function(cid) {
console.log('------- join --------');
console.log(cid);
var pid = cid || $rootScope.peerId;
$location.path('join/' + pid);
};
});