I am using below code and when i am calling onMessageRender()
function, so it says "this is not a function"
request = new Atmosphere.AtmosphereRequest(); // Global Function
Calling below code in ngONinIt
this.createSSE();
//Main function
createSSE(){ this.request.onMessage = function (response) {
console.log('request.onMessage trigger');
try {
let jsonData = JSON.parse(message);
console.log('Normal Message JSON this.request.util', jsonData);
this.onMessageRender();
}catch (e) {
console.log('Error in websocket onmessage: ', e);
return;
} }
Created below function globally
onMessageRender(){
}
Please let me know if you need more information. Thanks!