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