jq方法中拿到angular属性

     // 初始化方法
     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();

      });

    }
阅读更多

没有更多推荐了,返回首页