Show More
@@ -38,15 +38,17 b' function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResour' | |||||
38 | }; |
|
38 | }; | |
39 | stateHolder.websocket.onmessage = function (event) { |
|
39 | stateHolder.websocket.onmessage = function (event) { | |
40 | var data = JSON.parse(event.data); |
|
40 | var data = JSON.parse(event.data); | |
41 |
|
|
41 | $scope.$apply(function (scope) { | |
42 | console.log('channelstream-message', message); |
|
42 | _.each(data, function (message) { | |
43 | if(typeof message.message.topic !== 'undefined'){ |
|
43 | console.log('channelstream-message', message); | |
44 | $rootScope.$broadcast( |
|
44 | if(typeof message.message.topic !== 'undefined'){ | |
45 | 'channelstream-message.'+message.message.topic, message); |
|
45 | $rootScope.$broadcast( | |
46 | } |
|
46 | 'channelstream-message.'+message.message.topic, message); | |
47 |
|
|
47 | } | |
48 | $rootScope.$broadcast('channelstream-message', message); |
|
48 | else{ | |
49 | } |
|
49 | $rootScope.$broadcast('channelstream-message', message); | |
|
50 | } | |||
|
51 | }); | |||
50 | }); |
|
52 | }); | |
51 | }; |
|
53 | }; | |
52 | stateHolder.websocket.onclose = function (event) { |
|
54 | stateHolder.websocket.onclose = function (event) { |
General Comments 0
You need to be logged in to leave comments.
Login now