I have a Angular project and I use the Signalr inside it. But when I get the connectionId , I can print it. But I can't assign it in the global variable. This is my code:
connection = new signalR.HubConnectionBuilder().withUrl("http://localhost:8178/notifyHub").build();
connection.start().then(function () {
connection.invoke("GetConnectionId").then(function (connectionId) {
console.log(connectionId);
// var temp=connectionId
})
}).catch(err => console.error(err));
var temp=""or inside typescript constructorvar temp:string = "";and then assign inside typescript class.