如何关闭@aspnet/signalr中的连接?

How to close connection in @aspnet/signalr?

我使用依赖"@aspnet/signalr": "^1.1.4".

如何在析构函数中关闭连接 Angular?

我试过:

 this.connection.close();

试试这个:

if (this.connection) {
   this.connection.stop();
   this.connection= undefined;
}

此致