I am trying to configure an Angular 2 application to use Microsoft SignalR. I follow this guide , which, although good, I don’t like the fact that jQuery and SignalR are loaded into the application through script tags in the index.html file, and the fact that both libraries do not use their respective type definitions.
With that in mind, I tried to include jQuery and SignalR in my application using node modules and corresponding type definitions. I searched for the correct type definition files to use through Microsoft TypeSearch .
I only include jQuery in my application due to SignalR's dependence on jQuery.
JQuery
I started by installing the jQuery module in my application, which I also had to add to the Webpack configuration. After it was established, I ran into the problem of “conflict” over Transport. This is described on the Aurelia JS Rocks website. Despite the fact that he offers to remove the protractor sets, I tried another solution at the moment , described in this answer . I do not know if this is the best solution.
SignalR
As for SignalR, I'm a little stuck - it still seems that there is no “official” node module for SignalR. I'm not sure if it is worth including the Microsoft SignalR Javascript library by downloading the file and including it in my application.
The problem is that I set the type definitions for SignalR. But now I'm not sure how to actually use SignalR, because when I type $ or jQuery , for example, I am not offered .connections - this makes sense, since it is not part of the jQuery library.
I am sure that I could misunderstand something in connection with its configuration. What is the best way to use SignalR in an Angular2 TypeScript application?
source share