Accessing $ (JQuery) in ng2 service #1280

Closed
opened 2025-08-09 17:19:32 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @bencameron00 on 11/3/2016

Greater starter pack!

I am trying to connect to a signalr hub from a service using this starter but cannot access $ and getting...

Exception: Call to Node module failed with error: Error: Uncaught (in promise): ReferenceError: $ is not defined.

My service uses these 2 lines...

declare var $;
this.connection = $.hubConnection('http://localhost:5000/' + 'signalr/');

Should jQuery be mapped correctly and be accessible like this?

I have a copy of the code at https://github.com/bencameron00/Ng2JQueryHub

Thanks
Ben

*Originally created by @bencameron00 on 11/3/2016* Greater starter pack! I am trying to connect to a signalr hub from a service using this starter but cannot access $ and getting... Exception: Call to Node module failed with error: Error: Uncaught (in promise): ReferenceError: $ is not defined. My service uses these 2 lines... declare var $; this.connection = $.hubConnection('http://localhost:5000/' + 'signalr/'); Should jQuery be mapped correctly and be accessible like this? I have a copy of the code at https://github.com/bencameron00/Ng2JQueryHub Thanks Ben
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1280
No description provided.