mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
21 lines
No EOL
505 B
CoffeeScript
21 lines
No EOL
505 B
CoffeeScript
define [
|
|
"base"
|
|
"ide/chat/services/chatMessages"
|
|
], (App) ->
|
|
App.controller "ChatController", ($scope, chatMessages, @ide, $location) ->
|
|
$scope.chat = chatMessages.state
|
|
|
|
$scope.$watchCollection "chat.messages", (messages) ->
|
|
if messages?
|
|
$scope.$emit "messages:updated"
|
|
|
|
$scope.sendMessage = ->
|
|
chatMessages
|
|
.sendMessage $scope.newMessageContent
|
|
.then () ->
|
|
$scope.newMessageContent = ""
|
|
|
|
$scope.loadMoreMessages = ->
|
|
chatMessages.loadMoreMessages()
|
|
|
|
|