Closing an Angular UI Modal on a SocketIO Event
I've been stuck for a while on this and I'm really not sure what else to
do. Basically I have a program that needs to create an Angular UI Modal
when there is only one person in a SocketIO 'Room', and once another
person comes into that room, the Modal needs to close. The SocketIO events
(modalStart) and (modalEnd) are correct, but I'm not sure how to close out
of that first modal. Any help would be greatly appreciated.
angular.module('CoderCombatApp.controllers', [])
.controller('mainCntrl', ['$scope', 'socket', '$modal', function
($scope, socket, $modal) {
socket.on('join', function (room) {
socket.emit('init', room);
});
socket.on('modalStart', function(){
$modal({
template: '../../views/pairing-modal.html',
show: true,
keyboard: false,
scope: $scope
});
});
socket.on('modalEnd', function(){
//END THAT MODAL ABOVE
})
}]);
Thank you so much!
No comments:
Post a Comment