// 初始化方法
public initsignalr() {
// 这个方法里面用That就可拿到angular属性
const that = this;
const url = Urls.serverUrl + '/signalr';
this.connection = $.hubConnection(url, { useDefaultPath: false });
this.connection.qs = {'siteId': 'DemoSiteForEnginuity', 'secId': this.chatlink.secId};
this.proxy = this.connection.createHubProxy(this.proxyName);
this.proxy.on('receiveMessage', function(msg){
that.messageDataTemp.push(msg);
that.getConversationdataTemp2 = [];
that.showMessage(this.messageDataTemp);
$('#nvPortalmessageTextarea').val('').focus();
});
}
jq方法中拿到angular属性
最新推荐文章于 2023-01-13 10:35:33 发布