Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何从服务调用strophejs插件状态?_Angular_Chat_Strophe_Strophe.js - Fatal编程技术网

Angular 如何从服务调用strophejs插件状态?

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

我已经安装了strophejs插件chatstates,在一对一的聊天中发送用户的合成状态。我的代码中存在与本地strophe的连接

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文件中添加特定节点模块的路径才能建立连接