let mes :string;
const connection = hubConnection('http://domain.com/');
const hubProxy = connection.createHubProxy('signalrserver');
connection.start()
.done(function(){
console.log('Now connected, connection ID=' + connection.id);
hubProxy.invoke('sendMessages');
})
.fail(function(){ console.log('Could not connect'); });
hubProxy.on('sendMessages', function(message) {
mes = message;
console.log("abc", mes);
});
console.log("cba", mes);
Message from SignalR is coming. I want to send notification to the user after receiving the message.but out of function message undefined.what would be the reason
console.log("abc", mes)->message is displayed in console.
console.log("cba", mes)->message is not displayed in console.result -> cba undefined
`this.localNotifications.schedule({
id: 1,
text: mes
});`
Message from SignalR is coming. I want to send notification to the user after receiving the message.but out of function message undefined.what would be the reason
console.log("abc", mes)->message is displayed in console. console.log("cba", mes)->message is not displayed in console.result -> cba undefined