4

I am using asp.net mvc 4.5 project with typescript in client side. I have installed and configured signalR in the server side. In the client side i have installed signalr.TypeScript.DefinitelyTyped with jquery,

i have referred signalr by below in my typescript file on the top, ///

and i have created interface file for my hub,

interface SignalR {
    ForecastHub: {
        client: {
            DeleteProject(projectId: number)
        };
        server: {
            send(name: string, message: string)
        };
    };
}

and my main code in ts is below,

var client = $.connection.ForecastHub;
client.client.DeleteProject = function (projectId) {
    alert(projectId);
};

$.connection.hub.start().done(function () {
});

in the runtime i am getting an error 'Cannot read property 'ForecastHub' of undefined'

so how to import signalr in the typescript ts. please provide solution to integrate signalR in typescript project.

venu
  • 49
  • 1
  • 2

1 Answers1

-1

The below solution solves my problem,

How to load signalr.js in webpack inside Angular 2

Regards, Venu Perumal

venu
  • 49
  • 1
  • 2