User86477287 posted
Unable to connect signalR from ionic mobile app.
i'm facing the issue when i go to connect signalR from my application.I mentioned my code below please help me.
demo.ts
startSignalR(){
$(function () {
debugger
let script = document.createElement('script');
$.connection.hub.url = "http://localhost:53405/signalr/hubs";
$.connection.hub.start().done(function ()
{
console.log("hub done");
script.src = "../../assets/ExtraJs/test.js";
}).fail(function(e)
{
console.log(e);
});
});
}
When I debug this function i get an error like
jQuery.Deferred exception: Cannot read property 'hub' of undefined TypeError: Cannot read property 'hub' of undefined
$.connection.hub.url = "http://localhost:53405/signalr/hubs";
getting error with above statement. hub is
undefined.Please suggest the solution.
Thanks.