XMPP: AngularJs + Strophe.js

后端 未结 3 1774
日久生厌
日久生厌 2021-02-06 16:22

I have a basic XMPP client working on strophe.js.

On login I create handlers such as

connect = new Strophe.Connection(\'http://localhost/http-bind\');
..         


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-02-06 17:17

    Wrap Strophe in an Angular Service. Angular Services are meant to be use as singletons, so you will be able to instantiate the Strophe Service once, and use it everywhere (using Dependency Injection).

提交回复
热议问题