stephen-moyer / ngx-signalr-hubservice

Makes using SignalR in Angular 2/4 easy
MIT License
24 stars 5 forks source link

ReferenceError: $ is not defined #2

Closed coccor closed 6 years ago

coccor commented 6 years ago

When trying to connect I get this error. ReferenceError: $ is not defined at HubService.webpackJsonp.../../../../ngx-signalr-hubservice/ngx-signalr-hubservice.js.HubService.initConnection (ngx-signalr-hubservice.js:209) at HubService.webpackJsonp.../../../../ngx-signalr-hubservice/ngx-signalr-hubservice.js.HubService._connect (ngx-signalr-hubservice.js:249) at HubService.webpackJsonp.../../../../ngx-signalr-hubservice/ngx-signalr-hubservice.js.HubService.connect (ngx-signalr-hubservice.js:240)

I have jquery 3.2.1 included in package.json

coccor commented 6 years ago

Manage to find the solution. In package.json you need "signalr": "^2.2.2" and "jquery": "^3.2.1" In .angular-cli.json you need "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/signalr/jquery.signalR.js"]

@steveadoo32 Can you add this information in the README ?

stephen-moyer commented 6 years ago

Yes. I will add this information to the docs. Thanks!