SmartIT_Extensions/BMC/smart-it-full-helix/scripts/app/chat/chat-popup-window-controlle...

21 lines
753 B
JavaScript

"use strict";
(function () {
'use strict';
angular.module('myitsmApp')
.controller('ChatPopupWindowController', ['$scope', 'chatModel', function ($scope, chatModel) {
$scope.chatModel = chatModel;
var popupDetails = window.opener.popupDetails;
var unbinder = $scope.$watch(function () {
return chatModel.connected && chatModel.Client;
}, function (newVal) {
if (!newVal) {
return;
}
chatModel.generateChatWindowByRoomId(popupDetails.roomId).then(function (chatWindow) {
$scope.chatWindow = chatWindow;
});
unbinder();
});
}]);
})();