Angular 如何从服务调用strophejs插件状态?
我已经安装了strophejs插件chatstates,在一对一的聊天中发送用户的合成状态。我的代码中存在与本地strophe的连接Angular 如何从服务调用strophejs插件状态?,angular,chat,strophe,strophe.js,Angular,Chat,Strophe,Strophe.js,我已经安装了strophejs插件chatstates,在一对一的聊天中发送用户的合成状态。我的代码中存在与本地strophe的连接 this.connection = new Strophe.Connection(`${EJABBERD_URL}/bosh`, { mechanisms: [] }); strophejs插件mam,使用方法如下 this.connection.mam.query(jid, options); 但是,如果我使用 this.connection.chats
this.connection = new Strophe.Connection(`${EJABBERD_URL}/bosh`,
{ mechanisms: [] });
strophejs插件mam,使用方法如下
this.connection.mam.query(jid, options);
但是,如果我使用
this.connection.chatstates.sendComposing(jid, type);
错误为:
ERROR TypeError: Cannot read property 'sendComposing' of undefined
我写错了吗?
或者如何将ChatState与我的服务连接?必须在angular.json文件中添加特定节点模块的路径才能建立连接