SignalR的$ .hubConnection()不是函数 [英] SignalR's $.hubConnection() is not a function

查看:607
本文介绍了SignalR的$ .hubConnection()不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在基于示例示例,使用AngularJS实施SignalR股票行情自动收录器这里.但是我在连接到Signalr时遇到错误 TypeError:$ .hubConnection不是函数

Hi All i'm working on Implementing a SignalR Stock Ticker Using AngularJS based on an example over here. But i'm getting an error while connecting to signalr like this TypeError: $.hubConnection is not a function

这是显示错误的地方:

var initializeClient = function () {
      //Creating connection and proxy objects
       console.log("anil");
       connection = $.hubConnection();
       //console.log("anil.r");
       proxy = connection.createHubProxy('stockTicker');

       configureProxyClientFunctions();

       start();
        };

由于我刚开始使用Signalr,因此有很多困惑,有人可以帮助我解决这个问题.

Since I'm new to working on signalr , have got lots of confusion in it can anybody help me out of this .

推荐答案

  1. npm install -s signalr
  2. 将下一行添加到angular-cli.json

  1. npm install -s signalr
  2. Add the next lines to angular-cli.json

"scripts": [

...
"../node_modules/signalr/jquery.signalR.js"

],

这篇关于SignalR的$ .hubConnection()不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆