Skip to content Skip to sidebar Skip to footer

Xmpp: Angularjs + Strophe

The basic XMPP with strophe and javascript wants to convert to AngularJS. .controller('loginCtrl', function(xmppAuth) { xmppAuth.auth(login, password); }) and in service:

Solution 1:

See the Strophe.js docs for addHandler:

The handler should return true if it is to be invoked again; returning false will remove the handler after it returns.

Therefore, your on_presence code should return true if you want it to be invoked again:

var on_presence = function(presence) {
    // do some stuffreturntrue;
};

Post a Comment for "Xmpp: Angularjs + Strophe"