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: .service('xmppAuth', function() { .return { auth: function(login, password) { connect = new Strophe.Connection(domain); connect.connect(login, password, function (status) { if (status === Strophe.Status.CONNECTED) { connect.addHandler(on_roster_changed,"jabber:iq:roster", "iq", "set"); connect.addHandler(on_iq, null, "iq",""