Added the multipeer connections support

This commit is contained in:
Mario Colque 2014-03-31 16:48:43 -03:00
commit 99b81128fd
4 changed files with 125 additions and 78 deletions

View file

@ -2,21 +2,12 @@
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();
});
Network.init();
$scope.join = function(cid) {
console.log('------- join --------');
console.log(cid);
console.log('------- joining to ' + cid + ' --------');
var pid = cid || $rootScope.peerId;
$location.path('join/' + pid);